Permalink
Browse files

fix handling of timestamps in log files

  • Loading branch information...
1 parent b0f3890 commit e6c1d758e332ea2d067edaf7e34eaaa3abceda6c @depesz depesz committed Aug 9, 2012
Showing with 11 additions and 1 deletion.
  1. +10 −0 doc/changes.pod
  2. +1 −1 lib/OmniPITR/Program/Monitor.pm
View
10 doc/changes.pod
@@ -1,5 +1,15 @@
=head1 OmniPITR
+=head2 2012-08-08
+
+=over
+
+=item * Fix log line parsing in omnipitr-monitor - the bug in there prevented
+omnipitr-monitor from working when running on server with timezone "before" UTC
+(for example UTC-0400).
+
+=back
+
=head2 2012-07-02
=over
View
2 lib/OmniPITR/Program/Monitor.pm
@@ -116,7 +116,7 @@ sub parse_line {
my $line = shift;
my $epoch = $self->extract_epoch( $line );
- $self->log->fatal( 'Cannot parse line: %s', $line ) unless $line =~ s/\A(.{26}) \+\d+ : (\d+) : omnipitr-(\S+) : //;
+ $self->log->fatal( 'Cannot parse line: %s', $line ) unless $line =~ s/\A(.{26}) [+-]\d+ : (\d+) : omnipitr-(\S+) : //;
my $timestamp = $1;
my $pid = $2;
my $program_name = $3;

0 comments on commit e6c1d75

Please sign in to comment.