~~ Licensed to the Apache Software Foundation (ASF) under one or more ~~ contributor license agreements. See the NOTICE file distributed with ~~ this work for additional information regarding copyright ownership. ~~ The ASF licenses this file to You under the Apache License, Version 2.0 ~~ (the "License"); you may not use this file except in compliance with ~~ the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, software ~~ distributed under the License is distributed on an "AS IS" BASIS, ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~~ See the License for the specific language governing permissions and ~~ limitations under the License. ------ Introduction ------ ------ ------ Introduction * {Basic concepts} There are three main concepts in Apache log4php: loggers, appenders and layouts. These three types of components work together to enable developers to log messages according to message type and level, and to control at runtime how these messages are formatted and where they are reported. ** {Loggers, appenders and layouts} *** {Loggers} A logger is a component which will take your logging request and log it. Each class in a project can have an individual logger, or they can all use a common logger. Loggers are named entities; it is common to name them after the class which will use it for logging. *** {Appenders} Logging requests can be sent to multiple destinations. Such destinations are called appenders. Appenders exist for console, files, syslog, database, sockets and other output destinations. One or more appenders can be attached to a logger. Each enabled logging request for a given logger will be forwarded to all the appenders in that logger. *** {Layouts} More often than not, users wish to customize not only the output destination but also the output format. This is accomplished by associating a layout with an appender. All messages logged by that appender will use the given layout. Some appenders, such as the database appender (LoggerAppenderPDO) do not require a layout, since their output is not in form of a string. ** {Levels} A level describes the severity of a logging message. Log4PHP provides six levels, show here in descending order of severity. *----------*---------------*-------------------+ || Level || Severity || Description *----------*---------------*-------------------+ | FATAL | Highest | Very severe error events that will presumably lead the application to abort. *----------*---------------*-------------------+ | ERROR | ... | Error events that might still allow the application to continue running. *----------*---------------*-------------------+ | WARN | ... | Potentially harmful situations which still allow the application to continue running. *----------*---------------*-------------------+ | INFO | ... | Informational messages that highlight the progress of the application at coarse-grained level. *----------*---------------*-------------------+ | DEBUG | ... | Fine-grained informational events that are most useful to debug an application. *----------*---------------*-------------------+ | TRACE | Lowest | Finest-grained informational events. *----------*---------------*-------------------+