logging

Log4Net logging IP address of a single session accross several threads

Please refer to: http://stackoverflow.com/questions/1340643/how-to-enable-ip-address-logging-with-log4net which explains how to log an IP using log4net. My problem is that in certain cases extra threads are spawned that belong to a session. Now I need log4net to understand (or the thread) to be able to log with the correct IP. Current...

How to log exceptional situations in C++?

When writing a function, my implementation very frequently looks like this: Call a subfunction If this subfunction fails to execute (because of an exceptional situation): log this failure and abort the current function Otherwise continue calling other subfunctions, which in turn can fail A crucial part is the logging. Every function ...

Should logging reside within a class who's primary purpose is not logging?

This is more of a theoretical question. Should logging reside within a class who's primary purpose is not logging? Here is a simple interface for anything that will preform a calculation on a number. public interface ICalculation { public int calculate(int number); } Here is an implementation of the ICalculation interface that...

Enterprise Library Policy Injection Logging Managed Security Context Information in ASP.NET

I am using The Policy Injection Application Block to log methods that are called in my ASP.NET application. I would like these log entries to include information like the current user identity, whether the user is authenticated and so forth. All of this information is provided by the ManagedSecurityContextInformationProvider, but I can'...

How can I remove unwanted lines from jboss logs?

I made mistake and didn't remove debugging lines from code before it was deployed to production and some information that shouldn't be in logs is in jboss log files. How can I make java program to filter all unwanted lines by keword? Or is there any tool for this already? ...

Log4J not adding newlines between logfile entries

I am just starting with log4j. I don't have a problem with it reading my properties file and actually logging events, but it seems to be appending everything to the end of the same line. My properties file looks like this: # A1 is set to be a ConsoleAppender. log4j.appender.A1=org.apache.log4j.ConsoleAppender # A2 is set to be a Consol...

Unit Testing (PHPUnit): how to login?

hi there, I'm writing tests for my current project, made with Zend Framework. Everything fine, but I have a problem testing the logged users actions/controllers: I need to be logged in to be able to perform the action/controller. So my question is: How can I be logged in in PHPUnit? thans for reading :) ...

Centralized network logging - syslog and alternatives?

At work, we're building a distributed application (possibly across several machines on a LAN, possibly later across several continents on a WAN+VPN). We don't want log files local to each machine (filling up its disk and impossible to view in aggregate) so we need to centralize logging over the network. Most logs won't be important, so U...

ruby on rails logging out

Hi I am trying to create a view which allows the user to log out So what what I've got is: <%= link_to 'log out', :controller => "client", :action => "logout", :id => session[:id] %> but this gives me this error: No route matches "/client/logout/Lily" with {:method=>:get} Any help please? ...

how to use C# debugger (or anything else) to examine what happens during a GUI event in an open source app?

imagine that you are given a big nice app in C#, with full source code. So you want to figure out what methods are executed when you do a user event, e.g. press a button or press a hotkey or whatever. The codebase is so big that you don't feel like looking for the relevant part of the code manually, e.g. tracking down the event handler f...

Log4Net and logging from parallel instances

Hi. I'm using log4net in my project and there is one problem. The major function of the program takes a long time and I use logging to save information about it. I use FileAppender for saving log to file. My application is on the shared(local) folder and there could be several instances of the application running from one path. In this...

Is there a way to track all the queries that has been executed by the server?

I want to be able to see all the queries that has been executed on the server last 2 days etc. see the script, date of execution, sender etc. is there any way? I am using SQL X 2005. ...

How I can access the call log/history of iPhone

This is for jailbroken iPhone. Is there a way I can access the call_history.db on iPhone which is a database where apple logs the phone call information. It is stored at /private/var/mobile/Library/CallHistory directory. When I try to enumerate directory paths under /private/var/mobile/Library it does not list CallHistory folder but e...

python logging in django

Hi, I am using the basic python logger in django and it seems to be workng well. I have the logging setup in my setting.py as; logging.baseConfig(level = logging.NOTSET, format='a format', datemt=' a datefmt', filename='path to log', filemod...

Log User Activity on ASP.NET MVC Application

Is there A good strategy to Log the User activity on an ASP MVC App? (ActionFilters/ HTTPModules). Something like last user activity (just like StackOverflow "Seen 23 mins ago"), and even what Pages and Controllers were used, and pushing even further what buttons or links were clicked. I have ELMAH installed but as far as i know its j...

Logging into a two different log file types in Codeigniter

Is it possible in CI (natively) to log into two different files from two different controllers? I haven't found such option in user manual nor any solution in Google. Is there any 3rd party logging library available for CI? ...

AOP interception attribute

So, i have this problem, and no one seems to be able to help. So rather than keep bashing away i'm going to throw it out there for alternative ways to skin this particular cat. I currently have the following: public interface ICustomerService { Customer GetCustomer(int id); } public class CustomerService : ICustomerService { p...

How to do a junit assert on a message in a logger

I have some code-under-test that calls on a java logger to report its status. In the junit test code, I would like to verify that the correct log entry was made in this logger. Something along the following lines: methodUnderTest(bool x){ if(x) logger.info("x happened") } @Test tester(){ // perhaps setup a logger first...

How to control logging level in client library?

We'd like clients to be able to control logging levels in our client JAR. What is the best way to do this? Currently we just have a handful of log statements that write to System.out. I realize that using Log4J would solve this problem although one of our biggest clients doesn't use Log4J and uses their own custom logging implementati...

How to see the connection string used to connect to SQL Server

Is there a way to see what connection string was used to connect to SQL Server? Or rather what string was used in a failed login attempt. Many times I deal with complex systems in which I see failures caused by some service failing to log in to SQL. I am guessing the connection string might be wrong, but since I can't see what it was I ...