You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-user@logging.apache.org by tinkee <le...@gmail.com> on 2011/01/06 07:38:32 UTC

conversion pattern problem

hi!

I have a question regarding the LoggerLayoutPattern..

In my xml file i have the:

layout
  class - LoggerLayoutPattern
  param
     name - conversionPattern
     value - %d{Y-m-d H:m:s.u}|%p|%m| FILE: %F LINE: %L%n
  

however i think the Hour part of the timestamp is not consistent..
this is the ouput in the logfile:

2011-01-06 13:48:46.104 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
LINE: 11
2011-01-06 13:48:52.325 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
LINE: 11
2011-01-06 13:48:57.963 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
LINE: 11
2011-01-06 13:48:58.031 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
LINE: 11
*2011-01-06 05:49:03.970 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
LINE: 11
2011-01-06 13:51:46.948 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
LINE: 11
2011-01-06 13:51:52.560 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
LINE: 11
*2011-01-06 05:51:57.506 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
LINE: 11
2011-01-06 13:51:57.645 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
LINE: 11

please see the one with asterisk, it gives out a different timestamp.. 

did i miss out on something?

thanks a lot..

-- 
View this message in context: http://old.nabble.com/conversion-pattern-problem-tp30602890p30602890.html
Sent from the Log4php - Users mailing list archive at Nabble.com.


Re: conversion pattern problem

Posted by tinkee <le...@gmail.com>.

Hello Ivan,

as of the moment, i was not able to replicate again the scenario.
i tried restarting my system and it seems to give me the right dates now.

but anyways, i am using 'apache-log4php-2.0.0-incubating', should this be
okay?
and i am attaching the files too.
http://old.nabble.com/file/p30630825/log_configuration.xml
log_configuration.xml  http://old.nabble.com/file/p30630825/logtry.php
logtry.php 
ill update if the wrong timestamp would occur again.

thanks a whole lot.


Ivan Habunek wrote:
> 
> On 7.1.2011. 13:13, Christian Grobmeier wrote:
>> Ivan,
>> is this what you committed yesterday?
>> Christian
> 
> No, I just fixed a bug where the default conversionPattern would not be 
> used when no conversionPattern is specified.
> 
> I can see one problem in the date format used in the conversion pattern:
> %d{Y-m-d H:m:s.u}
> 
> Note that "m" will be replaced by the month, and it's used twice 
> mistakenly. The correct format should use "i" for minutes:
> %d{Y-m-d H:i:s.u}
> 
> Still, this should not produce the provided output (month and minutes 
> are not the same).
> 
> So, tinkee, can you please:
> 1) Tell us which version of log4php you are using
> 2) Attach the configuration file and code which produce this output.
> 
> Regards,
> Ivan
> 
> 

-- 
View this message in context: http://old.nabble.com/conversion-pattern-problem-tp30602890p30630825.html
Sent from the Log4php - Users mailing list archive at Nabble.com.


Re: conversion pattern problem

Posted by Christian Grobmeier <gr...@gmail.com>.
> as of the moment, i was not able to replicate again the scenario.
> i tried restarting my system and it seems to give me the right dates now.

weird :-)

> but anyways, i am using 'apache-log4php-2.0.0-incubating', should this be
> okay?

Yes, thats ok. The only other option you have is the trunk version,
but released versions are usually better for production systems

Cheers
Christian

> and i am attaching the files too.
>
> ill update if the wrong timestamp would occur again.
>
> thanks a whole lot.
>
>
> Ivan Habunek wrote:
>>
>> On 7.1.2011. 13:13, Christian Grobmeier wrote:
>>> Ivan,
>>> is this what you committed yesterday?
>>> Christian
>>
>> No, I just fixed a bug where the default conversionPattern would not be
>> used when no conversionPattern is specified.
>>
>> I can see one problem in the date format used in the conversion pattern:
>> %d{Y-m-d H:m:s.u}
>>
>> Note that "m" will be replaced by the month, and it's used twice
>> mistakenly. The correct format should use "i" for minutes:
>> %d{Y-m-d H:i:s.u}
>>
>> Still, this should not produce the provided output (month and minutes
>> are not the same).
>>
>> So, tinkee, can you please:
>> 1) Tell us which version of log4php you are using
>> 2) Attach the configuration file and code which produce this output.
>>
>> Regards,
>> Ivan
>>
>>
>
> --
> View this message in context: http://old.nabble.com/conversion-pattern-problem-tp30602890p30630818.html
> Sent from the Log4php - Users mailing list archive at Nabble.com.
>
>



-- 
http://www.grobmeier.de

Re: conversion pattern problem

Posted by tinkee <le...@gmail.com>.

Hello Ivan,

as of the moment, i was not able to replicate again the scenario.
i tried restarting my system and it seems to give me the right dates now.

but anyways, i am using 'apache-log4php-2.0.0-incubating', should this be
okay?
and i am attaching the files too.

ill update if the wrong timestamp would occur again.

thanks a whole lot.


Ivan Habunek wrote:
> 
> On 7.1.2011. 13:13, Christian Grobmeier wrote:
>> Ivan,
>> is this what you committed yesterday?
>> Christian
> 
> No, I just fixed a bug where the default conversionPattern would not be 
> used when no conversionPattern is specified.
> 
> I can see one problem in the date format used in the conversion pattern:
> %d{Y-m-d H:m:s.u}
> 
> Note that "m" will be replaced by the month, and it's used twice 
> mistakenly. The correct format should use "i" for minutes:
> %d{Y-m-d H:i:s.u}
> 
> Still, this should not produce the provided output (month and minutes 
> are not the same).
> 
> So, tinkee, can you please:
> 1) Tell us which version of log4php you are using
> 2) Attach the configuration file and code which produce this output.
> 
> Regards,
> Ivan
> 
> 

-- 
View this message in context: http://old.nabble.com/conversion-pattern-problem-tp30602890p30630818.html
Sent from the Log4php - Users mailing list archive at Nabble.com.


Re: conversion pattern problem

Posted by Ivan Habunek <iv...@gmail.com>.
On 7.1.2011. 13:13, Christian Grobmeier wrote:
> Ivan,
> is this what you committed yesterday?
> Christian

No, I just fixed a bug where the default conversionPattern would not be 
used when no conversionPattern is specified.

I can see one problem in the date format used in the conversion pattern:
%d{Y-m-d H:m:s.u}

Note that "m" will be replaced by the month, and it's used twice 
mistakenly. The correct format should use "i" for minutes:
%d{Y-m-d H:i:s.u}

Still, this should not produce the provided output (month and minutes 
are not the same).

So, tinkee, can you please:
1) Tell us which version of log4php you are using
2) Attach the configuration file and code which produce this output.

Regards,
Ivan

Re: conversion pattern problem

Posted by Christian Grobmeier <gr...@gmail.com>.
Ivan,
is this what you committed yesterday?
Christian

On Thu, Jan 6, 2011 at 7:38 AM, tinkee <le...@gmail.com> wrote:
>
> hi!
>
> I have a question regarding the LoggerLayoutPattern..
>
> In my xml file i have the:
>
> layout
>  class - LoggerLayoutPattern
>  param
>     name - conversionPattern
>     value - %d{Y-m-d H:m:s.u}|%p|%m| FILE: %F LINE: %L%n
>
>
> however i think the Hour part of the timestamp is not consistent..
> this is the ouput in the logfile:
>
> 2011-01-06 13:48:46.104 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
> LINE: 11
> 2011-01-06 13:48:52.325 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
> LINE: 11
> 2011-01-06 13:48:57.963 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
> LINE: 11
> 2011-01-06 13:48:58.031 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
> LINE: 11
> *2011-01-06 05:49:03.970 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
> LINE: 11
> 2011-01-06 13:51:46.948 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
> LINE: 11
> 2011-01-06 13:51:52.560 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
> LINE: 11
> *2011-01-06 05:51:57.506 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
> LINE: 11
> 2011-01-06 13:51:57.645 |DEBUG|Hello!|FILE:/var/www/html/log/logtry.php
> LINE: 11
>
> please see the one with asterisk, it gives out a different timestamp..
>
> did i miss out on something?
>
> thanks a lot..
>
> --
> View this message in context: http://old.nabble.com/conversion-pattern-problem-tp30602890p30602890.html
> Sent from the Log4php - Users mailing list archive at Nabble.com.
>
>



-- 
http://www.grobmeier.de