1 Reply Latest reply on Dec 13, 2013 8:54 AM by wdfink

    Logging best practice

    lachen

      I've always heard and seen articles that says to turn off console logging in production for performance. Question is, if JBoss is started as a service, or through a script, and the log messages are not displayed on screen, is that still an issue? Or is it still writing out to somewhere even if the console messages are not rolling on screen.

       

      What's the best practice for rolling logs, by date or file size? The log file can grow pretty large in a day, is it more common to have rolling logs based on file size?

       

      Is there a way for log files to be backed up to a different disk drive, or that's not achievable via JBoss, and should be handled by some sort of batch script?

        • 1. Re: Logging best practice
          wdfink

          Having a console appender for trash will have issues. Consider that the log message needs to be prepared, ok might be done anyway for other, but the appender is synchronous and you might have small possiblity here for a drawback.

          So I would remove it for productive instances, but you might redirect the output to a file because of other hard messages, i.e. crashes.

           

          Rolling and archiving depend on your requirements. I've used a custom-appender with a per size OR day what ever is first.

          If you have a disc space issue you might use a per-size handler and move the old logfiles to a external (slower) disc by cron and zipping it.