You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by V Jayakumar <vj...@hotmail.com> on 2006/05/18 12:47:07 UTC

Which conversion character would log timezone ?

In Log4j, which conversion character would help me to log the time zone 
along with the date.

For example, %d{MMM dd YYYY HH:mm:ss.SSS} would help me to print the time as

MAY 18 2006 12:12:34.234

I would like the see the time zone along with the date as MAY 18 2006 
12:12:34.234 BST

Could you someone let me know, how should I configure my pattern layout to 
achieve this ?

Thanks in advance for your help.



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Which conversion character would log timezone ?

Posted by Curt Arnold <ca...@apache.org>.
On May 18, 2006, at 5:47 AM, V Jayakumar wrote:

> In Log4j, which conversion character would help me to log the time  
> zone along with the date.
>
> For example, %d{MMM dd YYYY HH:mm:ss.SSS} would help me to print  
> the time as
>
> MAY 18 2006 12:12:34.234
>
> I would like the see the time zone along with the date as MAY 18  
> 2006 12:12:34.234 BST
>
> Could you someone let me know, how should I configure my pattern  
> layout to achieve this ?
>
> Thanks in advance for your help.

log4j uses java.text.SimpleDateFormat for date formatting which is  
documented at http://java.sun.com/j2se/1.5.0/docs/api/java/text/ 
SimpleDateFormat.html.  If you want the 3 letter abbreviation, then  
adding zzz should do it.  log4j 1.3 supports specifying the time zone  
by adding another pair of braces. 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Which conversion character would log timezone ?

Posted by lo...@xemaps.com.
 From the PatternLayout Javadoc:
	The date format specifier admits the same syntax as the time pattern  
string of the SimpleDateFormat.

So, you would use a "z" to get the timezone.


On May 18, 2006, at 6:47 AM, V Jayakumar wrote:

> * Replies will be sent through Spamex to log4j-user@logging.apache.org
> * For additional info click -> http://www.spamex.com/i/?v=3863091
>
> In Log4j, which conversion character would help me to log the time  
> zone along with the date.
>
> For example, %d{MMM dd YYYY HH:mm:ss.SSS} would help me to print  
> the time as
>
> MAY 18 2006 12:12:34.234
>
> I would like the see the time zone along with the date as MAY 18  
> 2006 12:12:34.234 BST
>
> Could you someone let me know, how should I configure my pattern  
> layout to achieve this ?
>
> Thanks in advance for your help.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>