Re: SV: [asterisk-users] Manage 'full' log file

2007-01-08 Thread Ex Vitorino

On 1/8/07, lenz <[EMAIL PROTECTED]> wrote:


You know that if you rename an open Unix file, it will stay open - i.e. if
you rename the logfile "full" to "full.1", Asterisk will continue writing
to "full.1" thinking it was "full".
The "logger rotate" command forces all log files to be closed and reopened
with their canonical names, so your file is actually rotated.
Hope this helps
l.



 CORRECT about UNIX files, INCORRECT about "logger rotate" command.

 CORRECTION:

 "logger rotate" does:

 1. Closes the files
 2. Renames them (actually rotating them)
 3. Reopnes the canonical named files

 "logger reload" does effectively work as you described:

 1. Closes files
 2. Reopens canonical named files

 This is the command that should be used with logrotate, for
 example.


 EXAMPLE: (consider asterisk running and writing to messages file)

 # cd /var/log/asterisk
 # mv messages messages.old

 (asterisk still running and now writing to messages.old)
 (there is no file named messages)

 # /usr/sbin/asterisk -rx "logger reload"

 (asterisk closed messages.old and created a new messages file)


 Hope this is clear enough as its really late now...
 Please correct me if I'm wrong

 Cheers
--
 Ex Vito
___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: SV: [asterisk-users] Manage 'full' log file

2007-01-08 Thread lenz


You know that if you rename an open Unix file, it will stay open - i.e. if  
you rename the logfile "full" to "full.1", Asterisk will continue writing  
to "full.1" thinking it was "full".
The "logger rotate" command forces all log files to be closed and reopened  
with their canonical names, so your file is actually rotated.

Hope this helps
l.


In data Mon, 08 Jan 2007 14:28:19 +0100, <[EMAIL PROTECTED]> ha scritto:


Super! Thanks! Now I see how the script works a bit more clearly. :)

I still don't understand what happens if I run:
/usr/sbin/asterisk -rx 'logger rotate'

Can I run the above without having the script? What will the command do?

Regards,
Jan

-Ursprungligt meddelande-
Från: [EMAIL PROTECTED]  
[mailto:[EMAIL PROTECTED] För Lenz

Skickat: den 8 januari 2007 13:13
Till: Asterisk Users Mailing List - Non-Commercial Discussion
Ämne: Re: [asterisk-users] Manage 'full' log file

Hi Jan,
You should use the logrotate in order to delete the log on periodic  
intervals. This article is meant to do exactly the opposite :)
http://astrecipes.net/index.php?n=205 but you get an idea of how to  
setup log file rotation and how to notify Asterisk that it should open a  
new file after the log rotation.


Hope this helps
l.


On Mon, 08 Jan 2007 13:00:52 +0100, <[EMAIL PROTECTED]> wrote:


Hi,

I need some help on how to manage the "full" log file. It's getting
quite large now and I'd like to clear it. Is there any simple command
for this or should I just delete the file (need to be sure this won't
affect the system).

Also - how do I keep the log file from growing so large?

Thanks!

Regards,
Jan




--
Loway Research - Home of QueueMetrics
http://queuemetrics.loway.it
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
___
--Bandwidth and Colocation provided by Easynews.com --

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





--
Home of QueueMetrics - http://queuemetrics.loway.it

___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: SV: [asterisk-users] Manage 'full' log file

2007-01-08 Thread Tzafrir Cohen
On Mon, Jan 08, 2007 at 02:28:19PM +0100, [EMAIL PROTECTED] wrote:
> Super! Thanks! Now I see how the script works a bit more clearly. :)
> 
> I still don't understand what happens if I run:
> /usr/sbin/asterisk -rx 'logger rotate'
> 
> Can I run the above without having the script? What will the command do?

If you use that, make sure you don't have logrotate configured. I
generally find logrotate to be more robust and tunable. It is not
Asterisk's job to mess with the policy of log rotation on the system.

-- 
   Tzafrir Cohen   
icq#16849755jabber:[EMAIL PROTECTED]
+972-50-7952406   mailto:[EMAIL PROTECTED]   
http://www.xorcom.com  iax:[EMAIL PROTECTED]/tzafrir
___
--Bandwidth and Colocation provided by Easynews.com --

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


SV: [asterisk-users] Manage 'full' log file

2007-01-08 Thread jan.sarin
Super! Thanks! Now I see how the script works a bit more clearly. :)

I still don't understand what happens if I run:
/usr/sbin/asterisk -rx 'logger rotate'

Can I run the above without having the script? What will the command do?

Regards,
Jan

-Ursprungligt meddelande-
Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Lenz
Skickat: den 8 januari 2007 13:13
Till: Asterisk Users Mailing List - Non-Commercial Discussion
Ämne: Re: [asterisk-users] Manage 'full' log file

Hi Jan,
You should use the logrotate in order to delete the log on periodic intervals. 
This article is meant to do exactly the opposite :)
http://astrecipes.net/index.php?n=205 but you get an idea of how to setup log 
file rotation and how to notify Asterisk that it should open a new file after 
the log rotation.

Hope this helps
l.


On Mon, 08 Jan 2007 13:00:52 +0100, <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I need some help on how to manage the "full" log file. It's getting 
> quite large now and I'd like to clear it. Is there any simple command 
> for this or should I just delete the file (need to be sure this won't 
> affect the system).
>
> Also - how do I keep the log file from growing so large?
>
> Thanks!
>
> Regards,
> Jan
>


--
Loway Research - Home of QueueMetrics
http://queuemetrics.loway.it
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: SV: [asterisk-users] Manage 'full' log file

2007-01-08 Thread Mailinglisten

[EMAIL PROTECTED] schrieb:

Thanks for the quick response!

I read about logrotate at voip-info.org but I didn't quite understand it. I'm 
no asterisk/linux expert unfortunately.

First of all. What exactly does happen when I run:
/usr/sbin/asterisk -rx 'logger rotate'

Does it clear the file and create a new one? Can I run this manually without 
any interruption in the system?

And what does the script do? I understand it "rotates" the logs. But does it 
delete the old files? Where do I put the script? How do I run it? As you can see I'm 
really a newbie on this. Unfortunately the docs for asterisk are often with the 
expectation that you know everything... :)

Regards,
Jan

-Ursprungligt meddelande-
Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Ex Vitorino
Skickat: den 8 januari 2007 13:10
Till: Asterisk Users Mailing List - Non-Commercial Discussion
Ämne: Re: [asterisk-users] Manage 'full' log file

  We've been using logrotate without any issue... We're using
  the below quoted configuration. Notice the invocation of
  Asterisk's CLI "logger reload" command so as to close the
  old files and open new ones.

  Cheers,
--
  Ex Vito


  /var/log/asterisk/messages /var/log/asterisk/queue_log 
/var/log/asterisk/event_log {
weekly
rotate 52
dateext
compress
delaycompress
nocreate
missingok
sharedscripts
postrotate
/usr/sbin/asterisk -rx "logger reload"
endscript
  }
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
___
--Bandwidth and Colocation provided by Easynews.com --

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

  
This script goes into /etc/logrotate.d in a seperate file. It will 
compress the log weekly and store it in the same directory the original 
log was in.


-- F. Foerster
___
--Bandwidth and Colocation provided by Easynews.com --

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


SV: [asterisk-users] Manage 'full' log file

2007-01-08 Thread jan.sarin
Thanks for the quick response!

I read about logrotate at voip-info.org but I didn't quite understand it. I'm 
no asterisk/linux expert unfortunately.

First of all. What exactly does happen when I run:
/usr/sbin/asterisk -rx 'logger rotate'

Does it clear the file and create a new one? Can I run this manually without 
any interruption in the system?

And what does the script do? I understand it "rotates" the logs. But does it 
delete the old files? Where do I put the script? How do I run it? As you can 
see I'm really a newbie on this. Unfortunately the docs for asterisk are often 
with the expectation that you know everything... :)

Regards,
Jan

-Ursprungligt meddelande-
Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Ex Vitorino
Skickat: den 8 januari 2007 13:10
Till: Asterisk Users Mailing List - Non-Commercial Discussion
Ämne: Re: [asterisk-users] Manage 'full' log file

  We've been using logrotate without any issue... We're using
  the below quoted configuration. Notice the invocation of
  Asterisk's CLI "logger reload" command so as to close the
  old files and open new ones.

  Cheers,
--
  Ex Vito


  /var/log/asterisk/messages /var/log/asterisk/queue_log 
/var/log/asterisk/event_log {
weekly
rotate 52
dateext
compress
delaycompress
nocreate
missingok
sharedscripts
postrotate
/usr/sbin/asterisk -rx "logger reload"
endscript
  }
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
___
--Bandwidth and Colocation provided by Easynews.com --

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