Logrotate opensips.log

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Logrotate opensips.log

Marc Leurent
Hello All,
I'm trying to add logrotate to my opensips.log file without having to restart
opensips... if it is possible!
Here are my config files. I ask opensips to log to local6 and put it in
a /var/log/opensips.log file.
When I lanched logrotate /etc/logrotate.d/opensips, logrotate works, and main
file inode do not change and is truncated, but opensips doensn't log anymore
in the file.
Have you got any idea how to do it please?

Thanks!

/etc/opensips/opensips.cfg:
log_facility=LOG_LOCAL6


/etc/syslog.conf:
#log opensips messages to own log
local6.* /var/log/opensips.log

/etc/logrotate.d/opensips:
/var/log/opensips/opensips.log {
        rotate 7
        daily
        compress
        size=500M
        copytruncate
}


--
-- --
Marc LEURENT
Ingénieur VoIP

DECKPOINT SA
Une société du groupe VTX Telecom
================================================================
Rue Eugène-Marziano 15 - 1227 Les Acacias
http://www.vtx.ch - [hidden email]
----------------------------------------------------------------
VTX, votre partenaire telecom proche de vous !
================================================================

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Logrotate opensips.log

Zahid Mehmood
I use the following on RHEL4, using logrotate, and it works fine.

--

/var/log/openser.log {
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2>/dev/null` 2>/dev/null || true
    endscript
}

--
Zahid



-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Marc Leurent
Sent: Monday, March 09, 2009 6:28 AM
To: [hidden email]
Subject: [OpenSIPS-Users] Logrotate opensips.log

Hello All,
I'm trying to add logrotate to my opensips.log file without having to restart
opensips... if it is possible!
Here are my config files. I ask opensips to log to local6 and put it in
a /var/log/opensips.log file.
When I lanched logrotate /etc/logrotate.d/opensips, logrotate works, and main
file inode do not change and is truncated, but opensips doensn't log anymore
in the file.
Have you got any idea how to do it please?

Thanks!

/etc/opensips/opensips.cfg:
log_facility=LOG_LOCAL6


/etc/syslog.conf:
#log opensips messages to own log
local6.* /var/log/opensips.log

/etc/logrotate.d/opensips:
/var/log/opensips/opensips.log {
        rotate 7
        daily
        compress
        size=500M
        copytruncate
}


--
-- --
Marc LEURENT
Ingénieur VoIP

DECKPOINT SA
Une société du groupe VTX Telecom
================================================================
Rue Eugène-Marziano 15 - 1227 Les Acacias
http://www.vtx.ch - [hidden email]
----------------------------------------------------------------
VTX, votre partenaire telecom proche de vous !
================================================================

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Logrotate opensips.log

Marc Leurent
Thank you Zahid for your logrotate configuration, it's working great, it was
the restart of syslogd that I missed!

Best Regards,
Have a nice day!!

Le Tuesday 10 March 2009 23.23:31 Zahid Mehmood, vous avez écrit :
>     sharedscripts
>     postrotate
>         /bin/kill -HUP `cat /var/run/syslogd.pid 2>/dev/null` 2>/dev/null
> || true endscript



--
-- --
Marc LEURENT
Ingénieur VoIP

DECKPOINT SA
Une société du groupe VTX Telecom
================================================================
Rue Eugène-Marziano 15 - 1227 Les Acacias
http://www.vtx.ch - [hidden email]
----------------------------------------------------------------
VTX, votre partenaire telecom proche de vous !
================================================================

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users