Skip to main content

Posts

Showing posts with the label log4php

LOGGING IN PHP

Simple and easy way for logging in php First, install Apache log4php. create a configuration file named config.xml containing: 1.<configuration xmlns="http://logging.apache.org/log4php/"> 2.    <appender name="myAppender"> 3.        <param name="file" value="myLog.log" /> 4.    </appender> 5.    <root> 6.        <level value="WARN" /> 7.        <appender_ref ref="myAppender" /> 8.    </root> 9.</configuration> This configuration file does the following: line 2: Creates an appender named myAppender using appender class LoggerAppenderFile which is used for logging to a file. line 3: Sets the file parameter, which tells the appender to which file to write. line 6: Sets the root logger level to WARN. This means that logging requests with the level lower than WARN will ...