3

I have used Log4j and JDK Logger both for logging purpose, so i find it same as implementation. But now, i have to write a logging framework, which will help logging.

I think that JDK Logger is faster than Log4j, but Log4j is more flexible than JDK Logger. I am very confused which one to use.

My requirement, to log at multiple levels depending upon the user credentials, business logic complexity and database access layers, and service levels. Intimate the admin for any exception occurred. and much many more requirements.

Thanks.

UPDATE:

I just read in the log4j documentation, that log4j is capable of sending emails, whenever there is an error and/or exception. So, how to configure that.

M.J.
  • 14,866
  • 25
  • 70
  • 95

1 Answers1

1

The most important performance difference will be what device(s) you write to. The framework is likely to irrelevant. I suggest you use the built in Logger unless you need the features provide by log4j.

If you are writing specialised application level logging, why not write straight to a file or database or JMS as appropriate?

Peter Lawrey
  • 498,481
  • 72
  • 700
  • 1,075