Logging with log4j on tomcat jruby-rack for a Rails 3 application

后端 未结 2 385
一整个雨季
一整个雨季 2020-12-31 20:34

I just spent the better part of 3 hours trying to get my Rails application logging with Log4j. I\'ve finally got it working, but I\'m not sure if what I did is correct. I tr

2条回答
  •  盖世英雄少女心
    2020-12-31 21:01

    It's possible that your early tests with commons-logging were showing zero bytes files because of bufferSize.

    If your entries get flushed to the file when you stop Tomcat then this is indeed the case and you are falling foul of the default 8Kb buffer.

    To disable, for immediate flushing try...

    org.apache.juli.FileHandler.bufferSize = -1

    on the specific handler...

    So for localhost...

    2localhost.org.apache.juli.FileHandler.bufferSize = -1

提交回复
热议问题