Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
metamod:logging [2010-07-07 11:36:58] oysteint Added synopsis for php |
metamod:logging [2022-05-31 09:29:32] (current) |
||
|---|---|---|---|
| Line 32: | Line 32: | ||
| | | ||
| my $logger = get_logger($category); | my $logger = get_logger($category); | ||
| - | $logger-> | + | $logger-> |
| </ | </ | ||
| | | ||
| Line 57: | Line 57: | ||
| # after the logger is initialised you can do this | # after the logger is initialised you can do this | ||
| # Note that you don't need to include the log4php library as that has already been done | # Note that you don't need to include the log4php library as that has already been done | ||
| - | $logger = getLogger( $category ); | + | $logger = Logger::getLogger( $category ); |
| $logger-> | $logger-> | ||
| Line 78: | Line 78: | ||
| log4perl.logger.metamod.search=DEBUG, | log4perl.logger.metamod.search=DEBUG, | ||
| + | # prevent garbage from reaching the root logger | ||
| + | log4perl.additivity.metamod.search=0 | ||
| log4perl.appender.SEARCH_LOGGER=Log:: | log4perl.appender.SEARCH_LOGGER=Log:: | ||
| log4perl.appender.SEARCH_LOGGER.filename = /some/file | log4perl.appender.SEARCH_LOGGER.filename = /some/file | ||
| log4perl.appender.SEARCH_LOGGER.layout=Log:: | log4perl.appender.SEARCH_LOGGER.layout=Log:: | ||
| log4perl.appender.SEARCH_LOGGER.layout.ConversionPattern=%F on line: %L msg: %m%n | log4perl.appender.SEARCH_LOGGER.layout.ConversionPattern=%F on line: %L msg: %m%n | ||
| - | # prevent garbage from reaching | + | |
| - | log4perl.appender.SEARCH_LOGGER.additivity=0 | + | ==== Example screen appender ==== |
| + | |||
| + | The following configuration will send all log messages to the screen. | ||
| + | |||
| + | log4perl.rootLogger=DEBUG, | ||
| + | log4perl.appender.SCREEN=Log:: | ||
| + | log4perl.appender.SCREEN.stderr = 1 | ||
| + | log4perl.appender.SCREEN.layout=Log:: | ||
| + | log4perl.appender.SCREEN.layout.ConversionPattern=[%p] %c %m in %F at line %L%n | ||
| ===== Levels ===== | ===== Levels ===== | ||
| Line 91: | Line 101: | ||
| * FATAL: requires instant human assistance (IT operations). For instance full disks, lack of connection to database servers, file servers or LDAP. | * FATAL: requires instant human assistance (IT operations). For instance full disks, lack of connection to database servers, file servers or LDAP. | ||
| * ERROR: serious error, but isolated to current task/ | * ERROR: serious error, but isolated to current task/ | ||
| + | * Exceptions, even if caught later | ||
| * WARNING: Might be an error, but not necessarily. Should be looked at to see if it is an actual problem. | * WARNING: Might be an error, but not necessarily. Should be looked at to see if it is an actual problem. | ||
| - | | + | * milder Exceptions, usually caught |
| + | | ||
| + | * tracking user | ||
| + | * log in | ||
| + | * log out | ||
| + | * generate/ | ||
| + | * tracking of data: | ||
| + | * uploads | ||
| + | * moving | ||
| + | * deletion | ||
| + | * tracking of metadata | ||
| + | * source (ncdigest, harvest), ownertag | ||
| + | * installing/ | ||
| + | * changes of xmd-metadata | ||
| + | * uploading to search-database(s) | ||
| + | * | ||
| * DEBUG: Free to be used by the developers as they see fit during development. DEBUG logging should rarely be used in production. | * DEBUG: Free to be used by the developers as they see fit during development. DEBUG logging should rarely be used in production. | ||