How to rotate logs ever 10 minutes

397 views
Skip to first unread message

Sachin

unread,
Nov 11, 2009, 4:43:20 PM11/11/09
to Scribe Server
Hi,

How can we get the logs to rotate every 10 minutes. I have the
following config, but it does not work, it only rotates when the max
size is super seeded.

port=1463
max_msg_per_second=2000000
check_interval=3
num_thrift_server_threads=3


<store>
category=default
type=buffer
max_size=10000
create_symlink=yes
write_stats=yes
max_write_interval=1
buffer_send_rate=1
retry_interval=30
retry_interval_range=10
rotate_period=hourly
rotate_minute=39

<primary>
type=file
fs_type=std
file_path=/home/scribe/scribe_logs
rotate_period=hourly
rotate_minute=39
max_size=10000
</primary>

<secondary>
type=file
fs_type=std
file_path=/tmp/scribe_logs
max_size=10000
</secondary>

</store>

anthony

unread,
Nov 12, 2009, 9:45:04 PM11/12/09
to Scribe Server
Currently, you cannot configure scribe to rotate every 10 minutes.
Your config tells scribe to rotate every hour at 39 minutes past the
hour (or when the max_size is exceeded). I believe there are a couple
people working on adding support to configure scribe to rotate every n
minutes though.

Also, max_size, create_symlink, rotate_period, rotate_minute, and
write_stats only work if they are inside of a file store, not if you
put them inside of a buffer store. (So your rotate_period in your
primary store will work, but you rotate_period line inside your buffer
store won't do anything).

-Anthony

Sachin

unread,
Dec 7, 2009, 4:54:30 AM12/7/09
to Scribe Server
I have made the changes to support rolling of log files every x
minutes. What is the process to get the changes submitted, reviewed
and included in the main line.

Changes are in store.h and store.cpp:
1. Introduced a new value for rotate_period i.e minute
2. The value for rotate_minute will now be interpreted as rotate log
files every n minutes.

Thanks
Sachin

anthony

unread,
Dec 7, 2009, 3:46:24 PM12/7/09
to Scribe Server
Thank you for contributing. We appreciate having members of the open
source community working to improve Scribe.

However, it looks like Jano beat you to this one. Check out the most
recent Scribe commit:
http://github.com/facebook/scribe/commits/master

Also, the configuration options on the wiki have been updated to
reflect this new syntax. Let me know what you think.

And in the future, it looks like the best way to post a patch on
github is to do a 'pull request' and then send a message to the group.

Thanks,
Anthony

Sachin

unread,
Dec 7, 2009, 11:25:09 PM12/7/09
to Scribe Server
Wow, this looks much better and feature rich!

So if I set my rotate_period=5m, it will rotate the logs every 5
minutes?

Thanks
Sachin

Anthony Giardullo

unread,
Dec 7, 2009, 11:58:47 PM12/7/09
to scribe...@googlegroups.com
Yup.

-Anthony

Sachin

unread,
Dec 8, 2009, 12:27:58 AM12/8/09
to Scribe Server
Coooool! Thanks Guys, will test it and let you know if any issues.
Reply all
Reply to author
Forward
0 new messages