aspose file tools*
The moose likes Other Open Source Projects and the fly likes Log4j, How to create a logger? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Log4j, How to create a logger?" Watch "Log4j, How to create a logger?" New topic
Author

Log4j, How to create a logger?

M Jay
Ranch Hand

Joined: Sep 21, 2004
Posts: 66
Hi,

I am trying to use log4j to log activity within my web application, I've had a look at the tutorial at Apache's website but was not much helpful.

Basically I want to create 3 types of loggers:

1- Debug Logger (to log debug related stuff)
2- Error Logger (to log errors)
3- Performance Logger (to log performance related stuff)

How do I go about this?
Do I subclass the Logger class for each one of those?
And then how do I specify to which file each one logs?

If anyone can help me or direct me to a useful resource I would be grateful.

Thanks


SCJP J2SE 1.4<br />SCBCD J2EE 1.3
M Jay
Ranch Hand

Joined: Sep 21, 2004
Posts: 66
How do I specify the log file's name to be a dynamic name, for example if it's a daily rolling logger than I want the name of the file to have the date?
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
I thought the The complete log4j manual (in PDF format) was an excellent tutorial.
It's not free, but was written by log4j developer.

I didn't use the complete manual to get started with log4j, we just used the Short Introduction to log4j.

If those don't meet your needs, I'd suggest google to find some instructions that make more sense to you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Log4j, How to create a logger?
 
Similar Threads
log4j w/apache
Logging file
Log4J Debug levels and over-riding
JBoss & Log4j
Problem configuring Hibernate and JPA in Eclipse