• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

log4j struts weblogic 9.2

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Iam using apache log4j in struts application which is deployed on weblogic 9.2 app server.

I have configured the log4j.properties file so that i can write my application logs to c:/log folder.

This is not working, i have explored a lot on the net. but i could not find a solution.

I have explored a lot on weblogic help pages, but it could not help me. They were talking about logging the server logs instead of logging deployed application logs.

Please help me if anyone have worked on this..


Thanks,
Venkat
[ September 09, 2008: Message edited by: Venkata Guru ]
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your property file the same as it is in your other post?
If not, can you show it to us?
 
Venkata Sirish
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi thanks for replying,

Here is the content of the properties file.


#### Use two appenders, one to log to console, another to log to a file
#FATAL - for server-side problems encountered when a service is initialised or when accessing resource-related information.
#ERROR - for server-side problems of concern to a service or resource deployer.
#WARN - for server-side problems that are viewed as of no great concern (e.g. exceptions that are gulped) or for problems caused by information from a client that is in some way problematic.
#INFO - for general status and progress information that may be of use to a service or resource deployer.
#DEBUG - for general debugging information that may be of use to a developer.

# This implies that the hierarcy is that FATAL-ERROR-WARN-INFO-DEBUG. If we set the level to INFO only statements with the priority higer than the INFO are logged in.

#ALL < DEBUG < INFO < WARN < ERROR < FATAL < OFF
#It is recommend that the minimum level you use in a production system is INFO

log4j.rootCategory=DEBUG, warn, info,error,fatal,CONSOLE

# Print only messages of priority WARN or higher for your category
#log4j.category.warn=WARN
# Specifically inherit the priority level
#log4j.category.your.category.name=INHERITED

# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n

#### This appender writes all log statements with level >= WARN
log4j.appender.warn=org.apache.log4j.RollingFileAppender
log4j.appender.warn.Threshold=WARN
log4j.appender.warn.File=c:/log/warn.log
log4j.appender.warn.layout=org.apache.log4j.PatternLayout
log4j.appender.warn.layout.ConversionPattern=[%d{ISO8601}] %5p [%t] (%M:%F:%L) %x: - %m%n
#log4j.appender.warn.DatePattern='.'yyyy-MM-dd
# Control the maximum log file size
log4j.appender.warn.MaxFileSize=5000KB
# Archive log files (one backup file here)
log4j.appender.warn.MaxBackupIndex=100


#### This appender writes all log statements with level >= debug
log4j.appender.DEBUG=org.apache.log4j.RollingFileAppender
log4j.appender.DEBUG.Threshold=DEBUG
log4j.appender.DEBUG.File=c:/log/debug.log
log4j.appender.DEBUG.layout=org.apache.log4j.PatternLayout
log4j.appender.warn.layout.ConversionPattern=[%d{ISO8601}] %5p [%t] (%M:%F:%L) %x: - %m%n
#log4j.appender.DEBUG.DatePattern='.'yyyy-MM-dd
# Control the maximum log file size
log4j.appender.DEBUG.MaxFileSize=5000KB
# Archive log files (one backup file here)
log4j.appender.DEBUG.MaxBackupIndex=100


#### This appender writes all log statements with level >= ERROR
log4j.appender.error=org.apache.log4j.RollingFileAppender
log4j.appender.error.Threshold=ERROR
log4j.appender.error.File=c:/log/error.log
log4j.appender.error.layout=org.apache.log4j.PatternLayout
log4j.appender.error.layout.ConversionPattern=[%d{ISO8601}] %5p [%t] (%M:%F:%L) %x: - %m%n
#log4j.appender.error.DatePattern='.'yyyy-MM-dd
# Control the maximum log file size
log4j.appender.error.MaxFileSize=5000KB
# Archive log files (one backup file here)
log4j.appender.error.MaxBackupIndex=100

#### This appender writes all log statements with level >= FATAL
log4j.appender.fatal=org.apache.log4j.RollingFileAppender
log4j.appender.fatal.Threshold=FATAL
log4j.appender.fatal.File=c:/log/fatal.log
log4j.appender.fatal.layout=org.apache.log4j.PatternLayout
log4j.appender.fatal.layout.ConversionPattern=[%d{ISO8601}] %5p [%t] (%M:%F:%L) %x: - %m%n
#log4j.appender.fatal.DatePattern='.'yyyy-MM-dd
# Control the maximum log file size
log4j.appender.fatal.MaxFileSize=5000KB
# Archive log files (one backup file here)
log4j.appender.fatal.MaxBackupIndex=100


#### This appender writes all log statements with level >= INFO
log4j.appender.info=org.apache.log4j.RollingFileAppender
log4j.appender.info.File=c:/log/info.log
log4j.appender.info.Threshold=INFO
log4j.appender.info.layout=org.apache.log4j.PatternLayout
log4j.appender.info.layout.ConversionPattern=[%d{ISO8601}] %p %t %c - %m%n
#log4j.appender.info.DatePattern='.'yyyy-MM-dd
# Control the maximum log file size
log4j.appender.info.MaxFileSize=5000KB
# Archive log files (one backup file here)
log4j.appender.info.MaxBackupIndex=100



Thanks,
Venkat
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the console appender work?
I think the configuration may not be working because you are using log levels for the names of the appenders. If you look at the Log4j documentation and scroll down to "Configuration", you'll see that a logger can take both log levels and appenders as arguments. At the least your configuration is confusing. Try renaming your appenders.
 
reply
    Bookmark Topic Watch Topic
  • New Topic