473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 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 8121
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.