logging

Tomcat Access Log does not Show Response Header Value

We are setting a response header in one of our JSP pages, through the following code: response.setHeader("X-IA-Session", Integer.toString(clientsession.getS())); In the access log format pattern (server.xml) we added the snippet: %{X-IA-Session}o When checking with WGET the response header is returned correctly, with expected valu...

Diagnostics Trace: how to trace only one WCF endpoint

Hi, I have a WCF client that connects to multiple endpoints; some net.pipe, some https. The net.pipe endpoints have a fair amount of chatter but they work reliably, so I don't want to trace those, as the log file gets too big and cluttered too quickly. However, the https endpoint is fairly new and I need to trace that one. How do I tra...

Wanted red color for text in the error message in the log file

I have a question but not sure it is possible or not. I am using apache logger for my logging which creates a log file which works fine with no issues. My question is when I open the log file I get the different messages like messages with INFO,DEBGU,ERROR etc. But I want to see the error message in red color in text in my logger file....

how can I enable database logging in my ASP.net application

Hi, how can I enable database logging in my ASP.net application? I am using VS2010 (ASP.net MVC2 Project) and would like to see logging that highlights database activity between the application and the database, including database connection establishment (as I do have a connection related error somewhere). I'm using SqlServer Expre...

Is the Microsoft Enterprise Library 5.0 Logging Application Block thread safe?

I have some code that will be logging using the Logging Application Block in Enterprise Library 5.0 from different threads. Is the LAB thread safe? Can I log like normal from different threads or will I need to synchronize the logging code so that is only used from one thread at a time? ...

JdbcTemplate — logging the dataSource connection url

Hi, is there a way to log the JdbcTemplate's DataSource connection URL in Java? The field exists in the DataSource, but there ain't a getter to access it. Of course I could read the DataSource properties from the application context xml, but I'd like to do it the other way. ...

Log4j - Logging to multiple log files based on the project modules

Consider this scenario: I have a project with two modules and one common module as below (the package structure): com.mysite.moduleone com.mysite.moduletwo com.mysite.commonmodule In the above, the commonmodule classes can be used by other two modules. The question: I need to configureLog4J such a way that the log messages from m...

How to use log4j for a axis2 webservice

I have created a simple axis2 webservice to understand logging functionality in a webservice. in this sample webservice, when a client calls this webservice, first it reads the log4j.property file. then i can see the logs being printed on console. but i have included file appender too into the property file. but i can not file the log fi...

Logging exceptions to database in NServiceBus

If an exception occurs in my MessageHandler I want to write the exception details to my database. How do I do this? Obviously, I cant just catch the exception, write to database, and rethrow it since NSB rollbacks all changes. (IsTransactional is set to true) I tried adding logging functionality in a seperate handler, which I caledl us...

Asynchronous thread-safe logging in C++

I'm looking for a way to do asynchronous and thread-safe logging in my C++ project, if possible to one file. I'm currently using cerr and clog for the task, but since they are synchronous, execution shortly pauses every time something is logged. It's a relatively graphics-heavy app, so this kind of thing is quite annoying. The new logge...

Wrong timestamp in log4j XMLLayout

Hello, I set my log4j configuration to use two appenders (ConsoleAppender and RollingFileAppender) the ConsoleAppender is using this layout (PatternLayout: ConversionPattern=%d [%t] %-5p %c - %m%n) and the RollingFileAppender is using XMLLayout. So the problem is that the ConsoleAppender output is displaying the correct date when I log a...

tomcat log request parameters

Is there a way to log request parameters in Tomcat? If so, how? Thanks. ...

Logging to screen and to a file

What design pattern might apply to logging? What is normally used in this type of situation? Any good tutorials? I am writing a client-server application using C89 and gcc 4.4.4. I now need to implement some logging feature that will display log messages on the screen as well as log to a file. However, I don't want to display all log ...

Best Practices - Stored Procedure Logging

If you have a long running SP, do you log somehow it's actions or just wait for this message? "Command(s) completed successfully." I assume, that there can be plenty solutions on this subject, but is there any best practice - a simple solution that is frequently used? EDIT I've found an interesting link on this subject http://we...

Trying to provide a global logging function

I typically write my scripts with a structure like s #!/usr/bin/python import stuff def do_things(): print "FOO" def main(): do_things() if __name__ == "__main__": main() The problem I have is I'd like to have a logging function that is defined globally and I"m not really sure how to do this. I tried a decorator functi...

Logging to ProgramData folder with Enterprise Library

How do I configure the Enterprise Library Logging Application Block to place the log files in the ProgramData folder? AFAIK it's only possible to use relative paths (from the installation directory) or absolute paths to set the location in EntLib configuration. ...

logback - no end of line delimiter

I'm using logback 0.9.21 . Unfortunately it prints all messages to single line, there is no end of line character, even wrong one. I've got the pattern set right AFAIK: <pattern>%d{HH:mm:ss.SSS} %-5level %class (%thread) [%logger{36}] -- %msg%n</pattern> What's the catch? ...

What is the best way to handle multiple actions?

Like most web applications you have a method that gets called when you log in. There are a few things that may need to get done when logged in and over time this may increase. eg. logging, welcome emails, maintenance. Should events be used to do this or is there a better way?? I'm using C# and ASP.net MVC. Update This is already in its...

Replace text in code with counting numbers

Due to testing and time measuring I have to write some kind of log into an existing C# Winforms project. I want to minimize change to the application, so I'm limiting my question to replacing text by counting numbers: I want to pass a line: Log.WriteLine(position) many times in the code and then replace "position" with numbers start...

Apache Chainsaw successor ?

It looks like the development on Chainsaw has stopped 4 years ago (last development build dated 2006-03-02)... Anyone knows of a replacement tool providing the same functionality, but with more up to date releases ? ...