Differences between revisions 5 and 6
Revision 5 as of 2005-07-16 23:39:47
Size: 2030
Editor: 82-44-202-92
Revision 6 as of 2009-09-20 23:51:06
Size: 2030
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

== Tracing previous logs

In a particular event of an error it would be great if we could trace/write previous log statements within the same thread/task.

For example if the setting is set to ERROR and then an error occurs, it would be good to have a convenient way of then writing all the previous debug statements that would help in tracing problems.

logger.debug("1"); ...do something try {

  • ..do something

} catch {

  • logger.error("Error has occurred"); logger.write all debug statements since a certain point

} Obviously could implement in a custom caching solution, but a feature of storing statements from a certain checkpoint would be nice and allow for logging later if error occurs

Log Directories

Be great to have a way to specify that log4j should create the full path for a log file if the path does not exist. Would be nice to specify multiple files without having to duplicate the log directory. The logger can be intelligent enough to create the directories if it sees a directory path in one of the filenames. For example:

  • logdir="logs"
  • basiclog="basic.log"
  • advancedlog="advanced.xml"

This would do two things:

  1. Create the "logs" directory as a subdirectory to the current working directory.
  2. Create two files: basic.log and advanced.xml

Then, as an alternate mechanism:

  • logdir="logs"
  • basiclog="basic.log"
  • advancedlog="/var/logs/application/advanced.xml"

Two files are created: logs/basic.log and /var/logs/application/advanced.xml.

Hierarchy Levels

In PatternFormat, I would like to be able to indicate how many hierarchy levels to shave off of a class name. So I were shaving off 3 levels, I would see class names shaved like:

com.mycompany.myproduct.util.Foo => util.Foo com.mycompany.myproduct.client.ui.dialogs.Config => client.ui.dialogs.Config

The current %c and %C using {n} lets me keep n levels on the end of the name, but I'd rather state what's common across all the names and trim based on that

Log4JProjectPages/Log4jRequestedFeatures (last edited 2009-09-20 23:51:06 by localhost)