Bug#705600: logwatch: No output / report for php error log
forwarded 705600 http://sourceforge.net/tracker/?func=detailaid=3612823group_id=312875atid=1316826 Thanks Hi, i've forwarded the last patch to upstream. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#705600: logwatch: No output / report for php error log
Hi, could you please try attached patch? thanks WM thanks for your reply and the patch. After some tests i can confirm that this patch has fixed the Europe/Berlin timezone problem. But just noticed that some scripts are setting/using a different timezone at my server: [07-May-2013 08:03:24 UTC] PHP Warning: foo.bar and this patch won't catch this timezone. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#705600: Aw: Re: Bug#705600: logwatch: No output / report for php error log
Hi, could you please try attached patch? thanks WM sorry for the second mail in this short amount of time but just had some time to do more test. I'm not really familiar with regex but using the attached patch works here now with the different logfile syntax: [07-May-2013 08:03:24] PHP Warning: foo.bar [07-May-2013 08:03:24 Europe/Berlin] PHP Warning: foo.bar [07-May-2013 08:03:24 UTC] PHP Warning: foo.bardiff --git a/scripts/services/php b/scripts/services/php index adc0147..f8a5fe9 100644 --- a/scripts/services/php +++ b/scripts/services/php @@ -62,7 +62,7 @@ pop(@message_categories) if $detail 5; while() { my $line = $_; # skipping messages that are not within the requested range -next unless $line =~ /^\[($filter)\]/o; +next unless $line =~ /^\[($filter)(?: \w+\/\w+|)(?: \w+|)\]/o; $1 =~ /(\d+)-(\w+)-(\d+) (\d+):(\d+):(\d+)/; my $time;
Bug#705600: Aw: Re: Bug#705600: logwatch: No output / report for php error log
Hi! sorry for the second mail in this short amount of time but just had some time to do more test. I'm not really familiar with regex but using the attached patch works here now with the different logfile syntax: [07-May-2013 08:03:24] PHP Warning: foo.bar [07-May-2013 08:03:24 Europe/Berlin] PHP Warning: foo.bar [07-May-2013 08:03:24 UTC] PHP Warning: foo.bar Do you know why PHP formats the time in different formats? I've modified the patch slightly because the regex can be formatted more compact. Please test again. thanks WM diff --git a/scripts/services/php b/scripts/services/php index adc0147..a8574cd 100644 --- a/scripts/services/php +++ b/scripts/services/php @@ -62,7 +62,9 @@ pop(@message_categories) if $detail 5; while() { my $line = $_; # skipping messages that are not within the requested range -next unless $line =~ /^\[($filter)\]/o; +# the last part of the regex matches optionally occurring specification +# of timezones either in Continent/City or abbrevations like UTC +next unless $line =~ /^\[($filter)(?: \w+(?:\/\w+)?)?\]/o; $1 =~ /(\d+)-(\w+)-(\d+) (\d+):(\d+):(\d+)/; my $time;
Bug#705600: logwatch: No output / report for php error log
Hi, and thanks again for your reply. Do you know why PHP formats the time in different formats? At my server only the Europe/Berlin and UTC is logged, the first one was an example how logwatch is trying to use the logformat at the moment. The difference between Europe/Berlin and UTC seems to be caused by OwnCloud. I'm using de_DE.UTF8 for LC_ALL and they are overwriting this to en_US.UTF8 in their code. I've modified the patch slightly because the regex can be formatted more compact. Please test again. Just tested it and i can confirm this is working. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#705600: logwatch: No output / report for php error log
Hi, Am 2013-04-17 14:40, schrieb Chris: in /usr/share/logwatch/scrpts/services/php and this has fixed this problem for me. For the hardcoded type Europe/Berlin we can't use %Z because the output would be: CEST on my system and won't match Europe/Berlin. I don't know if there is a better way of matching this timezone instead of hardcoding it but at least it works for me. could you please try attached patch? thanks WM diff --git a/scripts/services/php b/scripts/services/php index adc0147..f8a5fe9 100644 --- a/scripts/services/php +++ b/scripts/services/php @@ -62,7 +62,7 @@ pop(@message_categories) if $detail 5; while() { my $line = $_; # skipping messages that are not within the requested range -next unless $line =~ /^\[($filter)\]/o; +next unless $line =~ /^\[($filter)(?: \w+\/\w+|)\]/o; $1 =~ /(\d+)-(\w+)-(\d+) (\d+):(\d+):(\d+)/; my $time;
Bug#705600: logwatch: No output / report for php error log
Subject: logwatch: No output / report for php error log Package: logwatch Version: 7.4.0+svn20120502rev103-1 Severity: normal Hi, when using php5-fpm in version 5.4 with logging enabled it seems that logwatch can't create a report for this logfiles. When pointing logwatch 7.3.6.cvs20090906-1squeeze1 to my logfiles which i'm logging in /var/log/php5 it tries to create a report for clam-update (which i haven't installed nor are any logfiles found for this on the server). After updating logwatch to 7.4.0+svn20120502rev103-1 this is fixed and logwatch don't try to create a report for clam-update but there is still no report for php-messages. Using --debug High in the console doesn't show any hints and calling the: cat /var/log/php5/php-error.log | /usr/bin/perl /usr/share/logwatch/scripts/services/php in the console just gives no output. I can't figure out whats wrong here, maybe the problem is the syntax of the logging lines: [16-Apr-2013 21:03:58 Europe/Berlin] PHP Fatal error: Call to a member function GetAssoc() on a non-object in /foo/bar.php on line 1223 -- System Information: Debian Release: 6.0.7 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable'), (3, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages logwatch depends on: ii perl 5.10.1-17squeeze6 Larry Wall's Practical Extraction ii postfix [mail-transpor 2.7.1-1+squeeze1 High-performance mail transport ag Versions of packages logwatch recommends: ii libdate-manip-perl6.11-1 module for manipulating dates Versions of packages logwatch suggests: ii fortune-mod 1:1.99.1-4 provides fortune cookies on demand -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#705600: logwatch: No output / report for php error log
Sorry, forgot to post some informations. In the debugging output the logfiles are found added: Logfile Name: php Logfile = /var/log/php5/php_error.log and processed correctly: Preprocessing LogFile: php '/tmp/logwatch.tuInlo08/php-archive' '/var/log/php5/php_error.log' /tmp/logwatch.tuInlo08/php Processing Service: php ( cat /tmp/logwatch.tuInlo08/php | /usr/bin/perl /usr/share/logwatch/scripts/services/php) 21 so it seems there is a problem in parsing this logfile in /usr/share/logwatch/scripts/services/php Additional i've found this part in the debug logfile: - php-messages Begin TimeFilter: Period is day TimeFilter: SearchDate is (16-Apr-2013 ..:..:..) TimeFilter: Debug SearchDate is (16-Apr-2013 ) -- php-messages End - -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#705600: logwatch: No output / report for php error log
Ok, after digging through the code i've just replaced: [code] my $date_format = '%d-%b-%Y %H:%M:%S'; [/code] with: [code] my $date_format = '%d-%b-%Y %H:%M:%S Europe/Berlin'; [/code] in /usr/share/logwatch/scrpts/services/php and this has fixed this problem for me. For the hardcoded type Europe/Berlin we can't use %Z because the output would be: CEST on my system and won't match Europe/Berlin. I don't know if there is a better way of matching this timezone instead of hardcoding it but at least it works for me. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org