You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by tedsolr <ts...@sciquest.com> on 2015/11/16 17:04:46 UTC

Solr logging in local time

Is it possible to define a timezone for Solr so that logging occurs in local
time? My logs appear to be in UTC. Due to daylight savings, I don't think
defining a GMT offset in the log4j.properties files will work.

thanks! Ted
v. 5.2.1



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-logging-in-local-time-tp4240369.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr logging in local time

Posted by tedsolr <ts...@sciquest.com>.
There is a property for timezone. Just set that in solr.in.sh and logging
will use it. The default is UTC.

SOLR_TIMEZONE="EST"



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-logging-in-local-time-tp4240369p4240434.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr logging in local time

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
The logging format is defined by log4j properties. Looking at Solr
5.3.1, we are using EnhancedPatternLayout, which apparently supports
just putting the timezone in braces after the date format:
http://stackoverflow.com/questions/9116425/apache-log4j-logging-with-specific-timezone

I'd try that as a first step.

Regards,
    Alex.
----
Solr Analyzers, Tokenizers, Filters, URPs and even a newsletter:
http://www.solr-start.com/


On 16 November 2015 at 12:52, tedsolr <ts...@sciquest.com> wrote:
> There are more than a dozen logging sources that are aggregated into Splunk
> for my application. Solr is only one of them. All the others are logging in
> local time. Perhaps there is a Splunk centric solution, but I would like to
> know what the alternatives are. Anyone know how to "fix" (as in define, not
> correct) the timezone for Solr logging?
>
> thanks
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-logging-in-local-time-tp4240369p4240400.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr logging in local time

Posted by tedsolr <ts...@sciquest.com>.
There are more than a dozen logging sources that are aggregated into Splunk
for my application. Solr is only one of them. All the others are logging in
local time. Perhaps there is a Splunk centric solution, but I would like to
know what the alternatives are. Anyone know how to "fix" (as in define, not
correct) the timezone for Solr logging?

thanks



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-logging-in-local-time-tp4240369p4240400.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr logging in local time

Posted by Walter Underwood <wu...@wunderwood.org>.
I’m sure it is possible, but think twice before logging in local time. Do you really want one day with 23 hours and one day with 25 hours each year?

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)


> On Nov 16, 2015, at 8:04 AM, tedsolr <ts...@sciquest.com> wrote:
> 
> Is it possible to define a timezone for Solr so that logging occurs in local
> time? My logs appear to be in UTC. Due to daylight savings, I don't think
> defining a GMT offset in the log4j.properties files will work.
> 
> thanks! Ted
> v. 5.2.1
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-logging-in-local-time-tp4240369.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr logging in local time

Posted by Shawn Heisey <ap...@elyograg.org>.
On 11/16/2015 9:04 AM, tedsolr wrote:
> Is it possible to define a timezone for Solr so that logging occurs in local
> time? My logs appear to be in UTC. Due to daylight savings, I don't think
> defining a GMT offset in the log4j.properties files will work.

I noticed this today when I upgraded from 5.2.1 to a 5.3.2 snapshot.

This is the adjustment that I made to my log4j.properties file to get
previous behavior back:

log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd
HH:mm:ss.SSS}{America/Denver} %-5p (%t) [%X{collection} %X{shard}
%X{replica} %X{core}] %c{2.} %m\n

I'm not sure how that's going to end up wrapping, but as I edit the
message it is wrapping at a place that might cause confusion.  To clear
that confusion up:  There is no space between the right curly brace
after the date pattern and the left curly brace before the timezone.

I'm aware that for one hour out of the year, there will be timestamp
overlap ... but to me, it's a worthwhile tradeoff for having timestamps
that can be easily compared to a wall clock.

Thanks,
Shawn