Logging To A File Log4j

[Solved] Logging To A File Log4j | Php - Code Explorer | yomemimo.com
Question : log4j output to logfile log4j.properties

Answered by : ankur-paul

log4j.rootLogger=DEBUG, STDOUT, file log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout log4j.appender.STDOUT.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File=mylogs.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{dd-MM-yyyy HH:mm:ss} %-5p %c{1}:%L - %m%n

Source : https://stackoverflow.com/questions/21881846/where-does-the-slf4j-log-file-get-saved | Last Update : Wed, 18 May 22

Question : log4j - Logging in Database

Answered by : togrul-ceferov

INSERT INTO logs (EventDate,Level,Logger,Location,Message) VALUES( 'date_here', 'INFO' , 'com.test.Test' ,'loc', REPLACE('%m','\'','') );

Source : https://stackoverflow.com/questions/53554193/logging-into-database-with-log4j | Last Update : Thu, 18 Aug 22

Answers related to logging to a file log4j

Code Explorer Popular Question For Php