View script | License | Download documentation as: HTML or editable |
Download script | History | Other scripts by: fvzv |
14-Dec 14:36 UTC
[0.082] 11.438k
[0.082] 11.438k
Documentation for: log4reb.rHow to configure logging. ------------------------ Log4reb uses a configuration file where you define the loggers, the appenders and the layouts. In this file, you also link one or more appenders to a logger. Each appender has its own layout. REBOL [ Title: "Properties for log4reb" Date: 19-Sep-2004 Name: 'log4reb-properties Version: 2.0.0 File: %log4reb.properties History: [ [22-Nov-2003 "Created this file" "Francois"] [1-Dec-2003 "First Public Release" "Francois"] [19-Sep-2004 "New property file for log4reb version 2.x.x" "Francois"] ] ] use [ loggers appenders layouts] [ ; <logger name> <constructor arguments> loggers: make block! [ logger1 [threshold: 'all appenders: [console-app file-app1]] logger2 [threshold: 'debug appenders: [file-app2 file-app3]] logger3 [threshold: 'info appenders: [file-app3]] logger4 [threshold: 'warn appenders: [file-app4 file-app5]] logger5 [threshold: 'error appenders: [file-app5 file-app6]] logger6 [threshold: 'fatal appenders: [console-app file-app1 file-app5]] logger7 [threshold: 'off appenders: [file-app6 file-app2 file-app4]] ] ; <appender name> <appender type> <constructor arguments> appenders: make block! [ console-app console-appender! [layout: 'short] file-app1 file-appender! [layout: 'long out: %file1.log] file-app2 file-appender! [layout: 'long out: %file2.log] file-app3 file-appender! [layout: 'long out: %file3.log] file-app4 file-appender! [layout: 'long out: %file3.log] file-app5 file-appender! [layout: 'long out: %file2.log] file-app6 file-appender! [layout: 'long out: %file1.log] ] ; <layout name> <layout type> <constructor arguments> layouts: make block! [ short pattern-layout! [pattern: "[%c] Signe Pourcent:%% - %m."] long pattern-layout! [pattern: "[%c] The exact time: %d\\dd-MMM-yyyy @ HH:MM:ss,SSS\\ - %p - %m."] ] init-log4reb loggers appenders layouts ] |