Day84 Log4j DailyRollingFileAppender || HTML Layout || Log4j using XML

Day84 Log4j DailyRollingFileAppender || HTML Layout || Log4j using XML

CloudFire Technologies

1 год назад

85 Просмотров

################################RollingFileAppender#######################################



log = C:\\Users\\admin\\Desktop\\JAVA_WORKSPACE\\Automation_TestBench\\src\\main\\resources\\logs
# Define the root logger with appender file
log4j.rootLogger = DEBUG, RollingAppender

# Define the file appender
log4j.appender.RollingAppender=org.apache.log4j.DailyRollingFileAppender

# Set the name of the file
log4j.appender.RollingAppender.File=${log}\\log.out

# Set the immediate flush to true (default)
log4j.appender.RollingAppender.ImmediateFlush=true

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

# Set the append-false, should not overwrite
log4j.appender.RollingAppender.Append=true

# Set the DatePattern
log4j.appender.RollingAppender.DatePattern='.' yyyy-MM-dd-a

# Define the layout for file appender
log4j.appender.RollingAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.RollingAppender.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n


#################################################################################################
HTML LAYOUT
#######################################################################################

# Define the root logger with appender file
log = /usr/home/log4j
log4j.rootLogger = DEBUG, FILE

# Define the file appender
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=${log}/htmlLayout.html

# Define the layout for file appender
log4j.appender.FILE.layout=org.apache.log4j.HTMLLayout
log4j.appender.FILE.layout.Title=HTML Layout Example
log4j.appender.FILE.layout.LocationInfo=true
######################################################################################
LOG4J using XML:
ref links:
https://www.javatpoint.com/log4j-xml Source code Available at Gitlab Link:
https://gitlab.com/cloudfire1/core_java.git

Тэги:

#java_interview_questions_for_automation_testing #software_automation_testing_tools #automation_testing_life_cycle #it_is_an_automation_testing_framework #certification_for_automation_testing #best_automation_testing_tools #learn_automation_testing #disadvantages_of_automation_testing #types_of_frameworks_in_automation_testing #is_automation_testing_a_good_career #selenium_automation_testing_tutorial #Data_Driven_Frameworks #Hybrid_Frameworks #BDD_Frameworks #Cucumber_Frameworks
Ссылки и html тэги не поддерживаются


Комментарии: