472,794 Members | 2,131 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,794 software developers and data experts.

Log4j not logging

Hi,
I have played with various settings in the log4j properties file. I've tried different logging levels also. Nothing is working! My application is not logging out anything.
Jan 5 '09 #1
5 8090
Dököll
2,364 Expert 2GB
If you ahve previously searched here for an answer... Try the sun site yet on this, couldn't hurt...

Care to also post your code:-)
Jan 6 '09 #2
JosAH
11,448 Expert 8TB
@eazyigz
You must've misconfigured the logging framework or you haven't configured it at all; read the short manual.

kind regards,

Jos
Jan 6 '09 #3
Ok, I managed to get it logging by playing around with values in the properties file. The original settings were as follows. Where it says ERROR, I added DEBUG and INFO.

Expand|Select|Wrap|Line Numbers
  1. log4j.debug = true
  2. log4j.rootLogger=OFF
  3. log4j.logger.com.iso.wc.fst=ERROR
  4. log4j.logger.com.iso.framework=ERROR, FFILE, FSNMP
  5. #################################### end of root and framework logger setting  #####################################
  6. log4j.appender.FFILE=com.iso.framework.logging.ISOWebDailyRollingFileAppender
  7. log4j.appender.FFILE.Directory=wdilogs
  8. log4j.appender.FFILE.LogFile=FSTWebISOFramework.log
  9. log4j.appender.FFILE.DatePattern='.'yyyy-MM-dd
  10. log4j.appender.FFILE.layout=org.apache.log4j.PatternLayout
  11. log4j.appender.FFILE.layout.ConversionPattern=- %-6p - | %d{yyyy-MM-dd HH:mm:ss.SSS} | [%t] | %C{1}.%M() | %m%n
  12.  
  13. log4j.appender.FSNMP=com.iso.framework.logging.SNMPAppender
  14. log4j.appender.FSNMP.threshold=ERROR
  15. log4j.appender.FSNMP.layout=org.apache.log4j.PatternLayout
  16. log4j.appender.FSNMP.layout.ConversionPattern=- %-6p - | %d{yyyy-MM-dd HH:mm:ss.SSS} | [%t] | %C{1}.%M() | %m%n
  17. log4j.additivity.com.iso.framework=false
  18. #################################### end of framework appenders #####################################
My question is this: is it allowed to specify multiple logging levels at once? Also, I'm trying to understand the package hierarchy with respect to log4j.logger.com.iso.wc.fst and log4j.logger.com.iso.framework. How does this hierarchy work?

Thank you!
Jan 7 '09 #4
jkmyoung
2,057 Expert 2GB
When you say specify multiple logging levels, do you mean for the specific message? Generally, if you are outputting WARN messages you're also outputting ERROR messages as well, so you can just put the output level to ERROR in this case. You can also just have multiple output statements for different log levels.

or do you mean something else entirely?
Jan 7 '09 #5
When I say multiple logging levels I mean specifying ERROR, DEBUG, TRACE, etc. all at once.
Jan 8 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Aaron Boxer | last post by:
Hello, My application is using a jar file MyJar.jar that uses log4j (I have the latest release of log4j). I have put both MyJar.jar and log4j.jar in a directory in my classpath. I have also...
2
by: Greg Scharlemann | last post by:
I have a various different packages within this web application that I am writing and I am attempting to set up log4j to log directly to a database. So each class is calling just a generic logger:...
4
by: Jan van Mansum | last post by:
Hello group, I have just been trying out the log4j library. As far as I understand the idea is to keep the logging statements in your, even in the release build. However, obviously you wouldn't...
2
by: BobReynolds | last post by:
We use Log4j for all our logging, I want to know why we have to do the following in EVERY class final private static org.apache.log4j.Logger log = LoggerUtil.getLogger(thisClassName.class); ...
5
by: Ravi Shankar | last post by:
Hi all, I have an enterprise application. I am using Apache Log4J for the logging purposes. WHen a request is received by the application, it goes throug servlets and many classes, and the...
3
by: Irmen de Jong | last post by:
Hello I'm using the logging module in Python 2.3.3, with a format string containing %(asctime). But it now dumps a full date +timestamp in the log, which is nice but sometimes I only want the...
23
by: Rotem | last post by:
Hi, while working on something in my current project I have made several improvements to the logging package in Python, two of them are worth mentioning: 1. addition of a logging record field...
10
by: Baurzhan Ismagulov | last post by:
Hello all, I want that each module has its own logger. I've defined the following config file: keys=f01 keys=console
0
by: sainiranji | last post by:
Hi All I have diffrent categories in diffrrent logging purpose and all are working fine...but now my requirment is to disable all at once . The below are change i did for disable all logges...
1
by: Kedar Kachare | last post by:
How to use Log4j to create log files using file appender in a Servlet? Also, how to make that Servlet read the log4j.properties file? I have tried following: My web.xml( I use Eclipse europa)...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.