Saturday, December 9, 2017

Java :Logger


-->





In Progress

LOG4J

1.WHAT ARE THE MAIN COMPONENTS/COMPONENTS OF LOG4J
·      LOGGER: CAPTURES
1.    LEVELS
[ALL|TRACE|INFO|WARN|DEBUG|ERROR|FATAL]
·      APPENDER: PUBLISHES INFORMATION

·      LAYOUT:DEFINES PATTERN
          [DATE|XML|SIMPLE|PATTERN|HTML]





2.HIGH LEVEL OBJECT RELATIONSHIP


3.
Define rootlooger
Assign file/rolling/jdbc appender to it
Assign layout |pattern layout
Assign conversion %m%n


list of loggers


AppenderSkeleton
AsyncAppender
ConsoleAppender
DailyRollingFileAppender
ExternallyRolledFileAppender
FileAppender
# Set the immediate flush to true (default) log4j.appender.FILE.ImmediateFlush=true

# Set the threshold to debug mode log4j.appender.FILE.Threshold=debug


 # Set the append to false, overwrite log4j.appender.FILE.Append=false


# Define the layout for file appender log4j.appender.FILE.layout=org.apache.log4j.PatternLayout log4j.appender.FILE.layout.conversionPattern=%m%n

# Set the maximum file size before rollover log4j.appender.FILE.MaxFileSize=5KB


JDBCAppender
JMSAppender
LF5Appender
NTEventLogAppender
NullAppender
RollingFileAppender
SMTPAppender
SocketAppender
SocketHubAppender
SyslogAppender
TelnetAppender
WriterAppender

No comments:

Post a Comment