• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

log4j not rolling daily on new server

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am administrating an web application that was not wrote by me,

Recently our team has decided to run the application on another server to make it more stable when user needs it.

The daily rolling function is not working on the new server, while it does in the old one

Here is the log4j.properties file:

log4j.rootCategory=DEBUG, stdout, DailyRolling
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %-2C{1}.%M(%L) | %m%n
log4j.appender.DailyRolling = org.apache.log4j.rolling.RollingFileAppender
log4j.appender.DailyRolling.File = ${catalina.home}/cdcpd-logs/cdcpd-trace.log
log4j.appender.DailyRolling.Append = true
log4j.appender.DailyRolling.rollingPolicy = org.apache.log4j.rolling.TimeBasedRollingPolicy
log4j.appender.DailyRolling.rollingPolicy.FileNamePattern = ${catalina.home}/cdcpd-logs/cdcpd-trace.%d{yyyy-MM-dd}.log
log4j.appender.DailyRolling.layout = org.apache.log4j.PatternLayout
log4j.appender.DailyRolling.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %-23c{1} - %-5p - %-2m%n

I tried to add -Dlog4j.debug into catalina.sh below is the debug message I got

log4j: Using URL [file:/cdcpd/apache-tomcat-7.0.53/webapps/cdcpd/WEB-INF/classes/log4j.properties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/cdcpd/apache-tomcat-7.0.53/webapps/cdcpd/WEB-INF/classes/log4j.properties
log4j: Parsing for [root] with value=[DEBUG, stdout, DailyRolling].
log4j: Level token is [DEBUG].
log4j: Category root set to DEBUG
log4j: Parsing appender named "stdout".
log4j: Parsing layout options for "stdout".
log4j: Setting property [conversionPattern] to [%d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %-2C{1}.%M(%L) | %m%n].
log4j: End of parsing for "stdout".
log4j: Parsed "stdout" options.
log4j: Parsing appender named "DailyRolling".
log4j: Parsing layout options for "DailyRolling".
log4j: Setting property [conversionPattern] to [%d{yyyy-MM-dd HH:mm:ss} %-23c{1} - %-5p - %-2m%n].
log4j: End of parsing for "DailyRolling".
log4j: Setting property [file] to [/cdcpd/apache-tomcat-7.0.53/cdcpd-logs/cdcpd-trace.log].
log4j: Setting property [fileNamePattern] to [/cdcpd/apache-tomcat-7.0.53/cdcpd-logs/cdcpd-trace.%d{yyyy-MM-dd}.log].
log4j: Setting property [append] to [true].
log4j: setFile called: /cdcpd/apache-tomcat-7.0.53/cdcpd-logs/cdcpd-trace.log, true
log4j: setFile ended
log4j: Parsed "DailyRolling" options.
log4j: Finished configuring.
log4j: Reading configuration from URL jndi:/localhost/cdcpd/WEB-INF/classes/log4j.properties
log4j: Parsing for [root] with value=[DEBUG, stdout, DailyRolling].
log4j: Level token is [DEBUG].
log4j: Category root set to DEBUG
log4j: Parsing appender named "stdout".
log4j: Parsing layout options for "stdout".
log4j: Setting property [conversionPattern] to [%d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %-2C{1}.%M(%L) | %m%n].
log4j: End of parsing for "stdout".
log4j: Parsed "stdout" options.
log4j: Parsing appender named "DailyRolling".
log4j: Parsing layout options for "DailyRolling".
log4j: Setting property [conversionPattern] to [%d{yyyy-MM-dd HH:mm:ss} %-23c{1} - %-5p - %-2m%n].
log4j: End of parsing for "DailyRolling".
log4j: Setting property [file] to [/cdcpd/apache-tomcat-7.0.53/cdcpd-logs/cdcpd-trace.log].
log4j: Setting property [fileNamePattern] to [/cdcpd/apache-tomcat-7.0.53/cdcpd-logs/cdcpd-trace.%d{yyyy-MM-dd}.log].
log4j: Setting property [append] to [true].
log4j: setFile called: /cdcpd/apache-tomcat-7.0.53/cdcpd-logs/cdcpd-trace.log, true
log4j: setFile ended
log4j: Parsed "DailyRolling" options.
log4j: Finished configuring.

Can anyone please help me
 
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

I'll copy this to the Open Source Projects forum which handles Log4J questions.
 
Marshal
Posts: 28295
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You didn't say whether that debugging output came from the new server or the old server. Although... it doesn't really matter because you should be comparing the debugging output from both servers to see what's different.

That's because "what's different" is the question to be answered, or at least some difference between the two servers is the cause of this problem.
 
Bras cause cancer. And tiny ads:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic