3

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.

1 Answer 1

2

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 
1
  • 4
    Looks like this is strftime-substitution only. It'd be nice to substitute hostnames or some other variables. Commented Aug 1, 2013 at 22:56

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.