Thursday, May 22, 2008

Log4j tip

A few log4j tips from mistakes I've made, or things I've struggled with recently.

  1. When using logging to send emails, send to an email group, that way if members that receive the email change, the group can be updated without having to touch the program.
  2. Be sure logging changes for live from test, you probably don't want to log debugging in live. Do it manually, use Ant scripts, whatever, but be sure that logging is set for live when deploying to live.
  3. When writing files to your local box (windows) where the server is running, have the log file path be c:\ Any more complicated of a path may not exist on another developers machine when they pull code out of CVS (or Subversion)
  4. Name our log files with [ProjectName]_log4j.log This should ensure that the file is unique.
Not sure if it's a must, but when I was making changes to log4j, they did not appear until I restarted the server.

No comments: