Question

I'm a new user of log4php and I have a problem with the time. The time logged in the log file is late of 2 hours compared with the real time. My configuration file contains:

< layout class="LoggerLayoutPattern"> < param name="conversionPattern" value="%-5level %date{Y-m-d H:i:s,u} %logger %msg%n" /> < /layout>

My configuration:

  • apache-log4php-2.3.0
  • WampServer 2.4 -x64
  • windows 7 64 bits

How can I get the correct time ? Thanks for any advice :)

Was it helpful?

Solution

Have you set a timezone in your php script?

You can set it like:

date_default_timezone_set('Europe/Amsterdam');

Or you can set it on the server in the php.ini or .htaccess files as shown in the following article. How to set a timezone on your PHP server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top