Re: [asterisk-users] OT - log rotation [solved]

2009-09-06 Thread Olivier
2009/9/5 Steve Edwards asterisk@sedwards.com

 snip
 You can, but I don't. I do it like this:

 snip


Very, very interesting practises.

Originally, I opened this thread when I wondered whether or not, I should
centralize logs (and from that original question, I came to study some tiny
details like finding why some software needs to be notified of log rotations
and why some appearantly don't ...).

What kept me from doing this before, is my capability to analyse a large
central log file compared to analyse several specific log files.
With a couple of grep commands, it should be possible to break a central
file back into several files, so the only downside of centralizing would be
having to edit those grep command lines.

To avoid that, have you tried tools like phpLogCon ?
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] OT - log rotation [solved]

2009-09-06 Thread Steve Edwards
 2009/9/5 Steve Edwards asterisk@sedwards.com

 snip
 You can, but I don't. I do it like this:

 snip

On Sun, 6 Sep 2009, Olivier wrote:

 Very, very interesting practises.

 Originally, I opened this thread when I wondered whether or not, I 
 should centralize logs (and from that original question, I came to study 
 some tiny details like finding why some software needs to be notified of 
 log rotations and why some appearantly don't ...).

 What kept me from doing this before, is my capability to analyse a large 
 central log file compared to analyse several specific log files. With a 
 couple of grep commands, it should be possible to break a central file 
 back into several files, so the only downside of centralizing would be 
 having to edit those grep command lines.

 To avoid that, have you tried tools like phpLogCon ?

Nope. Never heard of phpLogCon before.

Back when I did web farms, we would break the multi-GB daily log file down 
by web site so we could distribute the logs to the groups responsible for 
those sites.

For Asterisk farms, I just keep all the log messages in a single file. 
When I'm curious, I run a script that (using egrep) discards everything 
I'm expecting so I only have to look at the unexpected.

I don't use the log files for statistics. I write everything I need for 
statistics to the database from my [AGI empowered] dialplan.

-- 
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] OT - log rotation [solved]

2009-09-06 Thread Roderick A. Anderson
Steve Edwards wrote:
 2009/9/5 Steve Edwards asterisk@sedwards.com

 snip
 You can, but I don't. I do it like this:

 snip
 
 On Sun, 6 Sep 2009, Olivier wrote:
 
snip /

 To avoid that, have you tried tools like phpLogCon ?
 
 Nope. Never heard of phpLogCon before.

Since it hasn't come up I'll mention syslog-ng and SEC (Simple Event 
Correlator)

I saw a presentation at LinuxFest Northwest back in April and it looks 
good.  Still haven't got the tuits to try it yet but it is in the plan.


\\||/
Rod
-- 
 
 Back when I did web farms, we would break the multi-GB daily log file down 
 by web site so we could distribute the logs to the groups responsible for 
 those sites.
 
 For Asterisk farms, I just keep all the log messages in a single file. 
 When I'm curious, I run a script that (using egrep) discards everything 
 I'm expecting so I only have to look at the unexpected.
 
 I don't use the log files for statistics. I write everything I need for 
 statistics to the database from my [AGI empowered] dialplan.
 


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] OT - log rotation [solved]

2009-09-05 Thread Olivier

 Thank God Asterisk can be configured to use syslog. I think Asterisk should
 deprecate logging to files to encourage users to get with best
 practices.

 Do you imply asterisk -rx logger reload  is not needed anymore with
syslog ?


 Not looking for a flame-fest, but why are you using application specific
 log files?



Personnaly, I don't really know why I'm using Asterisk specific log files.
Maybe, using syslog would help to improve log management without changing
habits.
With syslog, do you still keep Asterisk log files separate from main
/var/log/syslog, for instance ?
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] OT - log rotation [solved]

2009-09-05 Thread Steve Edwards
On Fri, 4 Sep 2009, Steve Edwards wrote:

 Thank God Asterisk can be configured to use syslog. I think Asterisk 
 should deprecate logging to files to encourage users to get with 
 best practices.

On Sat, 5 Sep 2009, Olivier wrote:

 Do you imply asterisk -rx logger reload  is not needed anymore with 
 syslog ?

Correct. With syslog, the application (Asterisk, Apache, Sendmail, Kernel, 
and finally, as of 5.1.20, MySQL) just spews out whatever they have been 
configured to be loggable. Log rotation then becomes a single problem 
handled by a single application, syslogd.

 Personnaly, I don't really know why I'm using Asterisk specific log 
 files. Maybe, using syslog would help to improve log management without 
 changing habits.

Syslog removes log management from each application and puts it in one 
place (syslogd) with one configuration file (/etc/syslog.conf). Each 
application still gets to decide what should be logged, but what happens 
to the log message is up to syslogd.

 With syslog, do you still keep Asterisk log files separate from main 
 /var/log/syslog, for instance ?

You can, but I don't. I do it like this:

) Configure every host to use ntp so all hosts have the same accurate 
time.

) Configure every application to use syslog.

) Configure syslogd on every host to send all of the log messages to a 
single loghost. This means every host but the log host has a single line 
(except for comments) in /etc/syslog.conf -- *.* @loghost

) Configure syslogd on the log host to dump all of the log messages into a 
single file. Again, a single line -- *.* /var/log/system-log

) Each day, system-log is rotated to system-log-$(date +%d). This way, 
I always have 30 days of logs on tap to look at. After that, the log file 
is over-written. This way, I don't have to worry about logs consuming all 
disk space. If nobody noticed the problem in 30 days, it wasn't that 
important :)

This configuration means that no host except the log host accumulates log 
files that need to be looked at, analyzed, rotated, or deleted. All the 
action is in one place on one host.

When something bad is happening, you only have to look in a single place. 
True, it can be like trying to drink from a fire hydrant, but that's what 
grep is for.

I find that things rarely happen in isolation and having every log message 
in a single place, in a consistent format, and temporally close to each 
other helps me to figure out what's going on.

A disk drive in your PSTN to IAX conversion host logs that it's 
temperature has risen 3 degrees and your conference host logs 10 hangups 
in the same second. Is it related?

If the log messages are right next to each other on the screen in front of 
you, you might make a connection.

-- 
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] OT - log rotation [solved]

2009-09-04 Thread Olivier
From an off-list comment, I think the explanation is :
- some apps are opening and closing log files before and after each writing,
- some are leaving log files open.

When a log file is currently rotated, both apps can't append anything
anymore to log files.
Apps like Asterisk with wide open log files won't even try to do so until
they receive a signal telling them they can anew append data to log files.

Regards
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] OT - log rotation [solved]

2009-09-04 Thread Stanisław Pitucha
2009/9/4 Olivier oza-4...@myamail.com:
 From an off-list comment, I think the explanation is :
 - some apps are opening and closing log files before and after each writing,
 - some are leaving log files open.

 When a log file is currently rotated, both apps can't append anything
 anymore to log files.

That's not correct (on a *nix system anyways). In the second case, if
some app holds a descriptor of an open file and you move the file
around in the same filesystem, nothing changes. You can rename 'log'
to 'log.1', but it doesn't change the descriptor and the application
will still write to the file (it's just named differently).
The logger restart just does a { close(); open(); } and you're logging
to a new 'log' again. This way you don't lose any messages during the
rotation.

-- 
Kind regards,

Stanisław Pitucha, Gradwell Voip Engineer

T: 01225 800 831 | F: 01225 800 801 | E: s...@gradwell.net | www.gradwell.com

Gradwell – Internet for Business People
Phone Services | Business Broadband | Email  Website Hosting

Can switching to VoIP today put some change in your pocket?
Registered Address: 26 Cheltenham Street, Bath, BA2 3EX, UK. Company
Number: 3673235

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] OT - log rotation [solved]

2009-09-04 Thread Matt Riddell
On 4/09/09 10:31 PM, Stanisław Pitucha wrote:
 2009/9/4 Olivieroza-4...@myamail.com:
  From an off-list comment, I think the explanation is :
 - some apps are opening and closing log files before and after each writing,
 - some are leaving log files open.

 When a log file is currently rotated, both apps can't append anything
 anymore to log files.

 That's not correct (on a *nix system anyways). In the second case, if
 some app holds a descriptor of an open file and you move the file
 around in the same filesystem, nothing changes. You can rename 'log'
 to 'log.1', but it doesn't change the descriptor and the application
 will still write to the file (it's just named differently).
 The logger restart just does a { close(); open(); } and you're logging
 to a new 'log' again. This way you don't lose any messages during the
 rotation.

I think the potential problem comes if log rotation creates a new file, 
compresses the old one to a .tar.gz file and then creates a new one - if 
Asterisk doesn't know about this, it will not be able to log to the new 
file.

-- 
Cheers,

Matt Riddell
Director
___

http://www.venturevoip.com/news.php (Daily Asterisk News)
http://www.venturevoip.com/st.php (SmoothTorque Predictive Dialer)
http://www.venturevoip.com/c3.php (ConduIT3 PABX Systems)

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] OT - log rotation [solved]

2009-09-04 Thread Steve Edwards

On 4/09/09 10:31 PM, Stanisław Pitucha wrote:

2009/9/4 Olivieroza-4...@myamail.com:

 From an off-list comment, I think the explanation is :
- some apps are opening and closing log files before and after each writing,
- some are leaving log files open.

When a log file is currently rotated, both apps can't append anything
anymore to log files.


That's not correct (on a *nix system anyways). In the second case, if
some app holds a descriptor of an open file and you move the file
around in the same filesystem, nothing changes. You can rename 'log'
to 'log.1', but it doesn't change the descriptor and the application
will still write to the file (it's just named differently).
The logger restart just does a { close(); open(); } and you're logging
to a new 'log' again. This way you don't lose any messages during the
rotation.


On Sat, 5 Sep 2009, Matt Riddell wrote:


I think the potential problem comes if log rotation creates a new file,
compresses the old one to a .tar.gz file and then creates a new one - if
Asterisk doesn't know about this, it will not be able to log to the new
file.


If we're interested in I thinks :)

I think applications that create log files are a PITA -- so last century, 
so limiting.


Every application creating a different log file in a different format. 
Every application solving the same problems (i.e. file rotation) over and 
over again. Such a waste.


Syslog is ubiquitous, well documented, and offers flexibility beyond most 
applications.


Thank God Asterisk can be configured to use syslog. I think Asterisk 
should deprecate logging to files to encourage users to get with best 
practices.


Not looking for a flame-fest, but why are you using application specific 
log files?


--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users