Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently redirecting all my service's standard output (stdout and stderr) to a single file, by starting is as such:

java blablaargs &> service.out

However, that file grows quite large. Is it possible, without changing the service program itself (perhaps via some filter command), to split the output by day?

Note: "Use a logging framework in Java" is not the droi... answer I'm looking for, sometimes important output just goes to stdout, out of my control.

share|improve this question

You should configure logrotate to do this for you - that's it's job.

share|improve this answer

Take a look at something like cronolog

It will do exactly what you ask for, splitting log files based on template, reading from STDIN.

share|improve this answer

I would suggest using syslog (for syslog-ng's filter and rotating capabilities for example), especially if you already use it in your system.

In order to catch stdout and stderr to syslog, you can pipe your program's output to logger, e.g. for example: (from

my_script | logger -p local6.debug -t my_script 2>&1

see the man (1) logger.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.