Re: a question about log file rotation Thanks!

Bo Xu <[email protected]> Wed, 12 Oct 2016 10:13:18 -0400
Newsgroups gmane.comp.telephony.openh323gk.user
Message-ID <CAFgLER=Gs2mA+SOx9pUp6u3wgn60DU4WY6Jv=SxB=DmubBKVZQ@mail.gmail.com>
--===============4889157319989513059==
Content-Type: multipart/alternative; boundary=001a113cc1e84a0ff2053eab9876

--001a113cc1e84a0ff2053eab9876
Content-Type: text/plain; charset=UTF-8

Hi,

just want to let you know that I found the log-rotation part in:
https://www.gnugk.org/gnugk-manual-4.html


4.9 Section [LogFile] <https://www.gnugk.org/gnugk-manual.html#toc4.9>

This section defines log file related parameters. Currently, it allows
users to specify log file rotation options.


   - Filename=/var/log/gk_trace.log
   Default: N/A

   Set the output filename for the log file (same as -o on the command
   line). On Windows, backslashes in the file name have to be escaped.

   *This setting doesn't change when the config is reloaded!*
   - Rotate=Hourly | Daily | Weekly | Monthly
   Default: N/A

   If set, the log file will be rotated based on this setting. Hourly
   rotation enables rotation once per hour, daily - once per day, weekly -
   once per week and monthly - once per month. An exact rotation moment is
   determined by a combination ofRotateDay and RotateTime variables. During
   rotation, an existing file is renamed to CURRENT_FILENAME.YYYYMMDD-HHMMSS,
   where YYYYMMDD-HHMMSS is replaced with the current timestamp, and new lines
   are logged to an empty file. To disable rotation, do not configure the
   Rotate parameter or set it to 0.

   *Example 1 - rotate every hour (00:45, 01:45, ..., 23:45):*

   [LogFile]
   Rotate=Hourly
   RotateTime=45
   Filename=/var/log/gk_trace.log

   *Example 2 - rotate every day at 23:00 (11PM):*

   [LogFile]
   Rotate=Daily
   RotateTime=23:00
   Filename=C:\\Logs\\GnuGk.log

   *Example 3 - rotate every Sunday at 00:59:*

   [LogFile]
   Rotate=Weekly
   RotateDay=Sun
   RotateTime=00:59

   *Example 4 - rotate on the last day of each month:*

   [LogFile]
   Rotate=Monthly
   RotateDay=31
   RotateTime=23:00



On Wed, Oct 12, 2016 at 9:51 AM, Bo Xu <[email protected]> wrote:

> Hi,
>
> I am running GnuGK as the following:
> gnugk -c  ./gatekeeper.ini -o  ./log/gnugk.log -ttt
>
> can I control the log file size or do log rile rotation? for example, can
> I config the gatekeeper.ini so if the log file is bigger than 100MB then it
> will automatically log to a new one; or log file will do rotation
> automatically every day? Thanks!
>
> Regards,
> Bo Xu
>

--001a113cc1e84a0ff2053eab9876
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi,</div><div><br></div><div>just want to let you kno=
w that I found the log-rotation part in:</div><div><a href=3D"https://www.g=
nugk.org/gnugk-manual-4.html">https://www.gnugk.org/gnugk-manual-4.html</a>=
<br></div><div><br></div><div><br></div><div><h2 style=3D"color:rgb(85,169,=
141);font-weight:normal;font-stretch:normal;font-size:18px;font-family:aria=
l,sans-serif;line-height:22px;border-color:rgb(85,169,141);border-width:0px=
 0px 2px;border-style:none none solid;margin:16px 0px 5px"><a name=3D"ss4.9=
">4.9</a>=C2=A0<a href=3D"https://www.gnugk.org/gnugk-manual.html#toc4.9">S=
ection [LogFile]</a></h2><p style=3D"color:rgb(0,0,0);font-stretch:normal;f=
ont-size:13px;font-family:arial,sans-serif;line-height:16px;margin:10px 10p=
x 5px 0px">This section defines log file related parameters. Currently, it =
allows users to specify log file rotation options.</p><p style=3D"color:rgb=
(0,0,0);font-stretch:normal;font-size:13px;font-family:arial,sans-serif;lin=
e-height:16px;margin:10px 10px 5px 0px"></p><ul style=3D"color:rgb(0,0,0);f=
ont-family:arial,sans-serif;font-size:13px"><li><code>Filename=3D/var/log/g=
k_trace.log</code><br>Default:=C2=A0<code>N/A</code><br><p style=3D"font-st=
retch:normal;line-height:16px;margin:10px 10px 5px 0px">Set the output file=
name for the log file (same as -o on the command line). On Windows, backsla=
shes in the file name have to be escaped.</p><p style=3D"font-stretch:norma=
l;line-height:16px;margin:10px 10px 5px 0px"><b>This setting doesn&#39;t ch=
ange when the config is reloaded!</b></p></li><li><code>Rotate=3DHourly | D=
aily | Weekly | Monthly</code><br>Default:=C2=A0<code>N/A</code><br><p styl=
e=3D"font-stretch:normal;line-height:16px;margin:10px 10px 5px 0px">If set,=
 the log file will be rotated based on this setting. Hourly rotation enable=
s rotation once per hour, daily - once per day, weekly - once per week and =
monthly - once per month. An exact rotation moment is determined by a combi=
nation of<code>RotateDay</code>=C2=A0and=C2=A0<code>RotateTime</code>=C2=A0=
variables. During rotation, an existing file is renamed to CURRENT_FILENAME=
.YYYYMMDD-HHMMSS, where YYYYMMDD-HHMMSS is replaced with the current timest=
amp, and new lines are logged to an empty file. To disable rotation, do not=
 configure the=C2=A0<code>Rotate</code>=C2=A0parameter or set it to 0.</p><=
p style=3D"font-stretch:normal;line-height:16px;margin:10px 10px 5px 0px"><=
/p><dl><dt><b>Example 1 - rotate every hour (00:45, 01:45, ..., 23:45):</b>=
</dt><dd><p style=3D"font-stretch:normal;line-height:16px;margin:10px 10px =
5px 0px"><code>[LogFile]</code><br><code>Rotate=3DHourly</code><br><code>Ro=
tateTime=3D45</code><br><code>Filename=3D/var/log/gk_trace.log</code><br></=
p></dd></dl><p style=3D"font-stretch:normal;line-height:16px;margin:10px 10=
px 5px 0px"></p><p style=3D"font-stretch:normal;line-height:16px;margin:10p=
x 10px 5px 0px"></p><dl><dt><b>Example 2 - rotate every day at 23:00 (11PM)=
:</b></dt><dd><p style=3D"font-stretch:normal;line-height:16px;margin:10px =
10px 5px 0px"><code>[LogFile]</code><br><code>Rotate=3DDaily</code><br><cod=
e>RotateTime=3D23:00</code><br><code>Filename=3DC:\\Logs\\GnuGk.log</code><=
br></p></dd></dl><p style=3D"font-stretch:normal;line-height:16px;margin:10=
px 10px 5px 0px"></p><p style=3D"font-stretch:normal;line-height:16px;margi=
n:10px 10px 5px 0px"></p><dl><dt><b>Example 3 - rotate every Sunday at 00:5=
9:</b></dt><dd><p style=3D"font-stretch:normal;line-height:16px;margin:10px=
 10px 5px 0px"><code>[LogFile]</code><br><code>Rotate=3DWeekly</code><br><c=
ode>RotateDay=3DSun</code><br><code>RotateTime=3D00:59</code><br></p></dd><=
/dl><p style=3D"font-stretch:normal;line-height:16px;margin:10px 10px 5px 0=
px"></p><p style=3D"font-stretch:normal;line-height:16px;margin:10px 10px 5=
px 0px"></p><dl><dt><b>Example 4 - rotate on the last day of each month:</b=
></dt><dd><p style=3D"font-stretch:normal;line-height:16px;margin:10px 10px=
 5px 0px"><code>[LogFile]</code><br><code>Rotate=3DMonthly</code><br><code>=
RotateDay=3D31</code><br><code>RotateTime=3D23:00</code><br></p></dd><dd><d=
iv><br></div></dd></dl><p style=3D"font-stretch:normal;line-height:16px;mar=
gin:10px 10px 5px 0px"></p></li></ul><p style=3D"color:rgb(0,0,0);font-stre=
tch:normal;font-size:13px;font-family:arial,sans-serif;line-height:16px;mar=
gin:10px 10px 5px 0px"></p></div></div><div class=3D"gmail_extra"><br><div =
class=3D"gmail_quote">On Wed, Oct 12, 2016 at 9:51 AM, Bo Xu <span dir=3D"l=
tr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">boxuscie=
[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div =
dir=3D"ltr"><div>Hi,</div><div><br></div><div>I am running GnuGK as the fol=
lowing:</div><div>gnugk -c =C2=A0./gatekeeper.ini -o =C2=A0./log/gnugk.log =
-ttt<br></div><div><br></div><div>can I control the log file size or do log=
 rile rotation? for example, can I config the gatekeeper.ini so if the log =
file is bigger than 100MB then it will automatically log to a new one; or l=
og file will do rotation automatically every day? Thanks!</div><div><br></d=
iv><div>Regards,</div><div>Bo Xu</div></div>
</blockquote></div><br></div>

--001a113cc1e84a0ff2053eab9876--


--===============4889157319989513059==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--===============4889157319989513059==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________________

Posting: mailto:[email protected]
Archive: http://sourceforge.net/mailarchive/forum.php?forum_name=openh323gk-users
Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
Homepage: http://www.gnugk.org/
--===============4889157319989513059==--