Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to apply a date based custom filename for apache2 log files, which I want to use for clickheat. In the example it writes:

CustomLog "clickheat.%Y-%m-%d-%H" "%r" env=clickheat

But for me it creates a file with name clickheat.%Y-%m-%d-%H the variables are not substituted.

I have not found in apache2 docs which parameter should I enable or set.

share|improve this question
add comment

1 Answer

You have to send logs to command ("|/usr/bin/rotatelogs <path_with_format> <time|size>"). Like this one:

# Check path to rotatelogs and log file directory
CustomLog "|/usr/bin/rotatelogs /var/log/apache/clickheat.%Y-%m-%d-%H 3600" "%r" env=clickheat
share|improve this answer
1  
Looks like this is strftime-substitution only. It'd be nice to substitute hostnames or some other variables. –  lkraav Aug 1 '13 at 22:56
add comment

Your Answer

 
discard

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.