logging

Can you override the formatter for a specific log in log.properties

I am using log.properties to configure logging for a Java app. Each class gets its own logger named after itself (e.g. com.company.program.ClassX). I want to set a custom formatter for just one log, and leave the handler with the SimpleFormatter. Is this possible? I am not interested in using log4j or another of the other logging suite...

Are there tools that log user actions to help reproduce bugs?

As a test engineer, I often engage in exploratory testing. When I encounter a bug, it is not always immediately clear which steps led to the problem. So, obviously, I have to find the required steps to reproduce the problem. Depending on the situation, this can take a large amount of time. What would be really helpful is a logging tool ...

How do you reduce Java logging boilerplate code?

Every class that wants to use java.util.logging generally needs to declare a logger like this: public class MyClass { private static Logger _log = Logger.getLogger(MyClass.class.getName()); } How do you avoid this MyClass.class.getName() boilerplate code? ...

How to use PHP to delete X number of lines from the beginning of a text file.

I'm writing a PHP script and the script outputs a simple text file log of the operations it performs. How would I use PHP to delete the first several lines from this file when it reaches a certain file size? Ideally, I would like it to keep the first two lines (date/time created and blank) and start deleting from line 3 and delete X am...

Problem with Commons Logging / Log4j setup in spring webapp with tomcat 6

I have a problem wih a logging setup in a apring webapp deployed under tomcat 6. The webapp uses the commons-logging api, on runtime log4j should be used. The log file is created but remains empty - no log entries occur. the setup is the following: WEB-INF/web.xml: <context-param> <param-name>log4jConfigLocation</param-name> ...

Logging PreparedStatements in Java

One thing that always been a pain is to log SQL (JDBC) errors when you have a PreparedStatement instead of the query itself. You always end up with messages like: 2008-10-20 09:19:48,114 ERROR LoggingQueueConsumer-52 [Logger.error:168] Error executing SQL: [INSERT INTO private_rooms_bans (room_id, name, user_id, msisdn, nickname) VAL...

SharePoint and Log4Net

I'm looking for best practices to integrate log4net to SharePoint for web request, feature activation and all timer stuff. I have several subprojects in my farm, and I would like to have only one Log4Net.config file. [Edit] Not only I need to configure log4net for the web application, which is easy to do (I use global.asax, and a log...

Logging in Eclipse/OSGi plugins

I am starting to develop an Eclipse plugin (technically, an OSGi plugin) and one of the first problems I've run into is that I can't seem to control the commons-logging output as I normally would. I've included the commons-logging package in the plugin dependencies, and indeed, when I log something (at INFO or higher severity) it is log...

Fields people capture when logging - log4net

Hi guys I interested in knowing what fields people actual capture and use when logging within their applications when using loggers like log4net. This can range from debugging to testing to production and can be for thick client apps but I am thinking more about semantics of web apps (i.e. asp.net). Also, in the context of web (and ...

How do I log the entire trace back of a Ruby exception using the default Rails logger?

I am working on rails project and I am trying to get exceptions to be logged to the rails log files. I know I can call logger.error $! to get the first line of the exception logged to the file. But, I want to get the entire trace stack logged as well. How do I log the entire trace back of an exception using the default rails logger? ...

How do I get a helper method in a utility class to use its callers logger in log4net?

I have an executable that depending on the command line switch supplied looks something like: Program.cs - namespace DiskSpaceReporting { class Program { static void Main(string[] args) { if(args.Length == 1) { switch(args[0]) { case "-summarytotals": SummaryDiskSpaceReporter...

Silverlight Logging framework and/or best practices

Now that Silverlight 2 has finally shipped. I'm wondering if anyone has put together any logging frameworks for it, maybe something like enterprise library logging or log4net? I'm interesting in something that can perform tracing client side and also log messages to the server. So far the only project I have found is Clog on CodeProject...

Analyzing web application usage and user patterns using DB/application server logs?

I assume that most of the analyzing and tracking is done based on the data gathered from browser actions like page requests. Tools like AWStats, Google Analytics and Omniture take place in this. But there is also good amount of data available in databases or service level logs. For example GWT based application might be a bit tricky to ...

Getting Precise Times in PHP

I have noticed that regardless of a given script's execution time, every date() call will return the same timestamp regardless of where the function is called within the script. It looks like it just returns the time at which the script first started executing. For logging purposes, it would be extremely useful to be able to get increme...

How much to log within an application??? How much is too much...

Hi guys Just wondering how much people log within their applications??? I have seen this: "I typically like to use the ERROR log level to log any exceptions that are caught by the application. I will use the INFO log level as a "first level" debugging scheme to show whenever I enter or exit a method. From there I use th...

Way to preview (retroview) SQL queries of SQL Server Management Studio Express

Could you tell me, please, if it's possible to preview (or at least retroview, for example, in a kind of a log file) SQL commands which SQL Server Management Studio Express is about to execute (or has just executed)? In the past I used Embarcadero DBArtisan which shows SQL queries to be executed before actually running them on the serve...

How do I record the time every time I log on and log off of Windows XP?

I notice that Windows XP Event Viewer show a list of typical actions under System logs every time I start or shutdown Windows, and I can tell when my day starts and ends. Is there anyways I can record the time every time I lock my screen and every time I re-login? There maybe a way to fool System Event Logger into submission, but a fre...

Castle, AOP and Logging in .NET

Are there any tutorials or sample programs out there on using AOP, Castle, and logging in a .Net application? I have found pieces out there but I am looking for something more to help me form a more complete picture. Thanks, -Brian ...

what's the best way to implement logging during transactions in T-SQL?

I want to implement a simple debug log, which consists of a table into which I insert insightful messages about the current state of a transaction. How do I stop inserts to this table being affected by rollbacks on the transaction that I'm trying to debug? In Oracle I can use PRAGMA AUTONOMOUS_TRANSACTION to ensure that the inserts are d...

How is profiling different from logging?

How is profiling different from logging? Is it just that profiling is used for performance measurements to see how long each function takes? Or am I off? Typically, how are profiling libraries used? What types of stats are obtained by profiling? ...