Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 648 Bytes

File metadata and controls

24 lines (17 loc) · 648 Bytes

log4j-logging

log4j is a very popular logging library for Java development. It provides convenient and flexible logging mechanism as well as fast performance.

Typically, configuring log4j involves in the following tasks:

  • Configure the root logger.
  • Configure individual loggers (if needed).
  • Specify appenders.
  • Specify message layout.

The specifiers used in the above example:

  • t: name of the current executing thread.
  • p: priority
  • c: category
  • m: log message.
  • n: line separator character.

There are three ways to configure log4j:

  • Using .properties file.
  • Using XML file.
  • Using Java code programmatically.