RT logs in wrong timezone

Hello, friends.

I noticed that my rt.log has been populated in the wrong timezone (GMT).
My timezone is BRT -03:00.

I found a discussion in which someone said to edit the RT.pm file and
change the gmtime.

Then I found what follows. Can I change that? If yes, how can I?

sub InitLogging {

my ($package, $filename, $line) = caller($frame);
$p{message} =~ s/(?:\r*\n)+$//;
my $str = “[”.gmtime(time)."] [".$p{level}."]: $p{message}
($filename:$line)\n";

Regards,

At PoP-SP/RNP, every day is an IPv6 day

Wagner Pereira
PoP-SP/RNP - Ponto de Presen�a da RNP em S�o Paulo
CCE/USP - Centro de Computa��o Eletr�nica da Universidade de S�o Paulo
http://www.pop-sp.rnp.br
Fixo. +55 11 3091-8901
M�vel. +55 11 9923-9554
fone@RNP: 10158902

Hello, friends.

I noticed that my rt.log has been populated in the wrong timezone
(GMT). My timezone is BRT -03:00.

I found a discussion in which someone said to edit the RT.pm file
and change the gmtime.

Then I found what follows. Can I change that? If yes, how can I?

RT logs in GMT (it does almost everything internally in GMT). If you
want to timestamp differently, we usually suggest logging to syslog or
to apache rather than to rt.log.

-kevin

It’s by design. Don’t use LogToFile in production. Use syslog and
logging to screen (STDERR).On Mon, Aug 15, 2011 at 7:11 PM, Wagner Pereira wpereira@pop-sp.rnp.br wrote:

Hello, friends.

I noticed that my rt.log has been populated in the wrong timezone (GMT). My
timezone is BRT -03:00.

I found a discussion in which someone said to edit the RT.pm file and change
the gmtime.

Then I found what follows. Can I change that? If yes, how can I?


sub InitLogging {

my ($package, $filename, $line) = caller($frame);
$p{message} =~ s/(?:\r*\n)+$//;
my $str = “[”.gmtime(time)."] [".$p{level}."]: $p{message}
($filename:$line)\n";

Regards,

At PoP-SP/RNP, every day is an IPv6 day

Wagner Pereira
PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Fixo. +55 11 3091-8901
Móvel. +55 11 9923-9554
fone@RNP: 10158902


RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011

Best regards, Ruslan.

Hi, Ruslan. I appreciate your answer.

Two points:

  1. My syslog is running in other server. How to make my RT send logs to it?
  2. Once I’ve changed from file to syslog, will the timezone issue be solved?

Regards,

At PoP-SP/RNP, every day is an IPv6 day

Wagner Pereira
PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Fixo. +55 11 3091-8901
Móvel. +55 11 9923-9554
fone@RNP: 10158902Em 15/08/2011 12:44, Ruslan Zakirov escreveu:

It’s by design. Don’t use LogToFile in production. Use syslog and
logging to screen (STDERR).

On Mon, Aug 15, 2011 at 7:11 PM, Wagner Pereirawpereira@pop-sp.rnp.br wrote:

Hello, friends.

I noticed that my rt.log has been populated in the wrong timezone (GMT). My
timezone is BRT -03:00.

I found a discussion in which someone said to edit the RT.pm file and change
the gmtime.

Then I found what follows. Can I change that? If yes, how can I?


sub InitLogging {

my ($package, $filename, $line) = caller($frame);
$p{message} =~ s/(?:\r*\n)+$//;
my $str = “[”.gmtime(time)."] [".$p{level}."]: $p{message}
($filename:$line)\n";

Regards,

At PoP-SP/RNP, every day is an IPv6 day

Wagner Pereira
PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Fixo. +55 11 3091-8901
Móvel. +55 11 9923-9554
fone@RNP: 10158902


RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26& 27, 2011
  • San Francisco, CA, USA October 18& 19, 2011
  • Washington DC, USA October 31& November 1, 2011
  • Melbourne VIC, Australia November 28& 29, 2011
  • Barcelona, Spain November 28& 29, 2011

написал:

Hi, Ruslan. I appreciate your answer.

Two points:

  1. My syslog is running in other server. How to make my RT send logs to
    it?

SyslogConf option may help. Read description.

  1. Once I’ve changed from file to syslog, will the timezone issue be
    solved?

Syslog tracks timestampts on its own.

Regards,

At PoP-SP/RNP, every day is an IPv6 day

Wagner Pereira
PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Fixo. +55 11 3091-8901
Móvel. +55 11 9923-9554
fone@RNP: 10158902

It’s by design. Don’t use LogToFile in production. Use syslog and
logging to screen (STDERR).

Hello, friends.

I noticed that my rt.log has been populated in the wrong timezone (GMT).
My

timezone is BRT -03:00.

I found a discussion in which someone said to edit the RT.pm file and
change

Ruslan,

I found the configuration…

destination remote_server { udp(“10.0.0.2” port(514)); };

…and restarted the daemon successfully.

But what exactly “remote_server” means?

At PoP-SP/RNP, every day is an IPv6 day

Wagner Pereira
PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Fixo. +55 11 3091-8901
Móvel. +55 11 9923-9554
fone@RNP: 10158902Em 15/08/2011 18:30, Ruslan Zakirov escreveu:

15.08.2011 22:51 пользователь “Wagner Pereira” <wpereira@pop-sp.rnp.br
mailto:wpereira@pop-sp.rnp.br> написал:

Hi, Ruslan. I appreciate your answer.

Two points:

  1. My syslog is running in other server. How to make my RT send logs
    to it?

SyslogConf option may help. Read description.

  1. Once I’ve changed from file to syslog, will the timezone issue be
    solved?

Syslog tracks timestampts on its own.

Regards,

At PoP-SP/RNP, every day is an IPv6 day

Wagner Pereira
PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Fixo. +55 11 3091-8901
Móvel. +55 11 9923-9554
fone@RNP: 10158902

Em 15/08/2011 12:44, Ruslan Zakirov escreveu:

It’s by design. Don’t use LogToFile in production. Use syslog and
logging to screen (STDERR).

On Mon, Aug 15, 2011 at 7:11 PM, Wagner Pereira<wpereira@pop-sp.rnp.br mailto:wpereira@pop-sp.rnp.br> wrote:

Hello, friends.

I noticed that my rt.log has been populated in the wrong timezone
(GMT). My

timezone is BRT -03:00.

I found a discussion in which someone said to edit the RT.pm file
and change

the gmtime.

Then I found what follows. Can I change that? If yes, how can I?


sub InitLogging {

my ($package, $filename, $line) = caller($frame);
$p{message} =~ s/(?:\r*\n)+$//;
my $str = “[”.gmtime(time)."] [".$p{level}."]: $p{message}
($filename:$line)\n";

Regards,

At PoP-SP/RNP, every day is an IPv6 day

Wagner Pereira
PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Fixo. +55 11 3091-8901
Móvel. +55 11 9923-9554
fone@RNP: 10158902


RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26& 27, 2011
  • San Francisco, CA, USA October 18& 19, 2011
  • Washington DC, USA October 31& November 1, 2011
  • Melbourne VIC, Australia November 28& 29, 2011
  • Barcelona, Spain November 28& 29, 2011

RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011

Ruslan,

I found the configuration…

destination remote_server { udp(“10.0.0.2” port(514)); };

No idea where you found that. I was referring to RT_Config.pm.

…and restarted the daemon successfully.

But what exactly “remote_server” means?

Best regards, Ruslan.

Ok, Ruslan.

Now I edited my RT_SiteConfig.pm to that:

LOGGING:

Set($LogToSyslog, ‘debug’);
Set(@LogToSyslogConf,
ident => ‘RTTEST’,
facility => ‘local0’,
socket => [{type => ‘udp’, host => ‘localhost’, port => 514 }],
);

Set($LogToSTDERR, ‘warning’); # former LogToScreen

And in the Syslog-ng.conf I did:

Send the messages to an other host

destination remote { udp(“10.1.1.10” port(514)); };

Until now, my main Syslog server is logging nothing. How to debug that?

Regards,

At PoP-SP/RNP, every day is an IPv6 day

Wagner Pereira
PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Fixo. +55 11 3091-8901
Móvel. +55 11 9923-9554
fone@RNP: 10158902Em 16/08/2011 18:41, Ruslan Zakirov escreveu:

On Tue, Aug 16, 2011 at 11:10 PM, Wagner Pereirawpereira@pop-sp.rnp.br wrote:

Ruslan,

I found the configuration…

destination remote_server { udp(“10.0.0.2” port(514)); };
No idea where you found that. I was referring to RT_Config.pm.

http://requesttracker.wikia.com/wiki/LogsConfig#Logging_into_syslog

…and restarted the daemon successfully.

But what exactly “remote_server” means?

Ok, Ruslan.

Now I edited my RT_SiteConfig.pm to that:


LOGGING:

Set($LogToSyslog, ‘debug’);
Set(@LogToSyslogConf,
ident => ‘RTTEST’,
facility => ‘local0’,
socket => [{type => ‘udp’, host => ‘localhost’, port => 514 }],
);

You said that you want to log directly to remote syslog host from RT.
You didn’t mention that you have local syslog daemon that redirects
messages to remote host.

You have two options:

  1. Drop LogToSyslogConf in RT_SiteConfig.pm that will give RT and
    modules it uses to find most appropriate way to connect to local
    syslog daemon. Configure local syslog daemon to forward messages
    and/or store them locally or do whatever you like with them, but using
    local syslog’s configs.

  2. Set LogToSyslogConf in RT properly to send messages to remote
    syslog daemon directly. Reminder: this requires quite new version of
    Sys::Syslog module from the CPAN.

I would recommend you to go with option 1). First of all test that
local syslog daemon actually connects to remote server and redirects
messages.

Set($LogToSTDERR, ‘warning’); # former LogToScreen

And in the Syslog-ng.conf I did:


Send the messages to an other host

destination remote { udp(“10.1.1.10” port(514)); };

Until now, my main Syslog server is logging nothing. How to debug that?

Regards,

Best regards, Ruslan.

Ruslan,

Ok, I will figure out how to connect the local Syslog with the remote
Syslog.

Thanks again.

At PoP-SP/RNP, every day is an IPv6 day

Wagner Pereira
PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Fixo. +55 11 3091-8901
Móvel. +55 11 9923-9554
fone@RNP: 10158902Em 17/08/2011 16:11, Ruslan Zakirov escreveu:

First of all test that
local syslog daemon actually connects to remote server and redirects
messages.

Hi, Ruslan.

I finally got it! It’s quite simple…thank you very much.

The text below is in brazilian Portuguese. If someone wants to
understand, it is just to use Google Translate or ask me how-to.

Para apontar um syslog-ng local para um syslog-ng remoto:

  1. No server do syslog-ng remoto o firewall precisa liberar entrada de
    udp na porta 514
  2. No syslog-ng local, arquivo syslog-ng.conf, acrescentar duas linhas
    (seções # Send the messages to an other host e # Log paths):
    destination rt {udp(“10.10.10.2” port(514));};
    log { source(s_src); destination(rt); };

Onde:
a. rt é uma identificação do serviço que está sendo logado ou do próprio
servidor
b. 10.10.10.2 é o IP do servidor remoto

  1. Reiniciar os daemons syslog-ng de ambos os servidores

  2. Configuração no RT_SiteConfig.pm (diretório do Request Tracker):
    ** Com isso o RT loga no Syslog-ng local.
    ** Comentadas as linhas que logam em arquivo

LOGGING:

Set($LogToSyslog, ‘debug’);
Set(@LogToSyslogConf,
ident => ‘RT’,
facility => ‘local0’,
socket => [{type => ‘udp’, host => ‘localhost’, port => 514 }],
);

Set($LogToSTDERR, ‘warning’); # antigo LogToScreen

#Set($LogToFile, ‘debug’);
#Set($LogDir, ‘/var/log/apache2/’);
#Set($LogToFileNamed , “rt.log”);

At PoP-SP/RNP, every day is an IPv6 day

Wagner Pereira
PoP-SP/RNP - Ponto de Presença da RNP em São Paulo
CCE/USP - Centro de Computação Eletrônica da Universidade de São Paulo
http://www.pop-sp.rnp.br
Fixo. +55 11 3091-8901
Móvel. +55 11 9923-9554
fone@RNP: 10158902Em 17/08/2011 16:11, Ruslan Zakirov escreveu:

On Wed, Aug 17, 2011 at 10:43 PM, Wagner Pereirawpereira@pop-sp.rnp.br wrote:

Ok, Ruslan.

Now I edited my RT_SiteConfig.pm to that:


LOGGING:

Set($LogToSyslog, ‘debug’);
Set(@LogToSyslogConf,
ident => ‘RTTEST’,
facility => ‘local0’,
socket => [{type => ‘udp’, host => ‘localhost’, port => 514 }],
);
You said that you want to log directly to remote syslog host from RT.
You didn’t mention that you have local syslog daemon that redirects
messages to remote host.

You have two options:

  1. Drop LogToSyslogConf in RT_SiteConfig.pm that will give RT and
    modules it uses to find most appropriate way to connect to local
    syslog daemon. Configure local syslog daemon to forward messages
    and/or store them locally or do whatever you like with them, but using
    local syslog’s configs.

  2. Set LogToSyslogConf in RT properly to send messages to remote
    syslog daemon directly. Reminder: this requires quite new version of
    Sys::Syslog module from the CPAN.

I would recommend you to go with option 1). First of all test that
local syslog daemon actually connects to remote server and redirects
messages.

Set($LogToSTDERR, ‘warning’); # former LogToScreen

And in the Syslog-ng.conf I did:


Send the messages to an other host

destination remote { udp(“10.1.1.10” port(514)); };

Until now, my main Syslog server is logging nothing. How to debug that?

Regards,