Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within BEA/Weblogic
Search Coderanch
Advance search
Google search
Register / Login
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:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
BEA/Weblogic
Weblogic Reads Log4j.properties File, But does not use file appender within it
salvin francis
Bartender
Posts: 2911
150
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I have two appenders:
log4j.rootLogger=debug, stdout log4j.rootCategory=debug, rolling log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=Custom Pattern 1 : %d{ABSOLUTE} %5p %c{1}:%L - %m%n # creating a logger file .... log4j.appender.rolling=org.apache.log4j.RollingFileAppender log4j.appender.rolling.File=MyLogFile.log log4j.appender.rolling.MaxFileSize=100KB log4j.appender.rolling.MaxBackupIndex=1 log4j.appender.rolling.layout=org.apache.log4j.PatternLayout log4j.appender.rolling.layout.ConversionPattern=Custom Pattern 2 : [%p %t %c - %m%n]
I am pretty sure weblogic Reads the log4j.properties file as i get output in Server console.
Custom Pattern 1 : 11:06:36,098 ERROR InvokerServlet:160 - This is the alert message at iteration 100.200
My way of refering to property file:
Logger logger=Logger.getLogger(InvokerServlet.class); String path=getServletContext().getRealPath("WEB-INF/classes")+"/log4j.properties"; PropertyConfigurator.configure(path);
I searched the entire webserver directory, I didnt find "MyLogFile.log"
What am i doing wrong over here ?
http://www.salvin.in
salvin francis
Bartender
Posts: 2911
150
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Problem solved, there was a problem with my log4j.properties file,
If it may help anyone, here is the corrected code:
old code:
log4j.rootLogger=debug, stdout log4j.rootCategory=debug, rolling
New Code:
log4j.rootLogger=INFO, stdout, rolling
http://www.salvin.in
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
log4j.properties: FileNotFoundException
Not able to save logs into .log file
log4j writing to multiple log
How to log statements using log4j in file and console with different log levels?
log4j refuses to write to file
More...