Announcement Announcement Module
No announcement yet.
Recommended log4j.xml configuration Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Recommended log4j.xml configuration

    I'm about to deploy in production a war that uses spring integration, I'm pretty sure that in this forum there is experienced people using SI in production.

    What log4j configuration do you recommend?

  • #2
    Many use a RollingFileAppender; keep the files a reasonable size, say 5M, and retain enough so they don't roll over too quickly.

    Stay away from patterns that include method name, line numbers (%M, %L) - they are expensive to capture.

    Often it is useful to deploy an MBean that allows you to dynamically change log levels on a per-logger basis using JMX.


    • #3
      Thanks Gary,

      I'm wondering about the SI packages to monitor (and at what level) to have full blown exceptions when something fails, but just enough info on normal execution.


      • #4
        INFO or even WARN is usually enough for a mature application.

        If you can afford the overhead and disk space, it is often useful to run with DEBUG at first so you can see messages flowing through and track down issues more easily. Having the ability to change log levels dynamically mitigates this somewhat, but I tend to like having too much logging at first, and cut back as things settle down. (This is my experience for any app, not just Spring Integration).