Reputation: 464
I have created log file on day basis but on day basis content have huge amount of data and difficult to download and open so i want to create on hour basis
Below the content of log4phpconfig.xml
Path :library\log4php\log4phpconfig.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://logging.apache.org/log4php/">
<appender name="default" class="LoggerAppenderDailyFile">
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{Y-m-d H:i:s} %c %-5p %F %L %m%n" />
</layout>
<layout class="LoggerLayoutSimple" />
<param name="file" value="/var/www/html/demoproject/webtoollogs/webtoollog-%s.log" />
<param name="datePattern" value="Y-m-d" />
</appender>
<root>
<appender_ref ref="default" />
</root>
</configuration>
Upvotes: 0
Views: 123
Reputation: 11
try this
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://logging.apache.org/log4php/">
<appender name="default" class="LoggerAppenderDailyFile">
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{Y-m-d H:i:s} %c %-5p %F %L %m%n" />
</layout>
<layout class="LoggerLayoutSimple" />
<param name="file" value="/var/www/html/demoproject/webtoollogs/webtoollog-%s.log" />
<param name="datePattern" value="Y-m-d.H" />
</appender>
<root>
<appender_ref ref="default" />
</root>
</configuration>
Upvotes: 1
Reputation: 514
Try this, In this case, a new file will be created each second.
<param name="datePattern" value="Y-m-d.H.i.s" />
In this case, a new file will be created each hour.
<param name="datePattern" value="Y-m-d.H" />
Upvotes: 0