Subject: | perl hooks not working with configuration file's variables |
consider this l4p configuration:
# --- 8< ----
LOG_DIR = var/log/my_perl_app/
HOSTNAME = sub { use Sys::Hostname; return hostname }
log4perl.rootLogger = INFO, Logfile
log4perl.appender.Logfile = Log::Log4perl::Appender::File
log4perl.appender.Logfile.filename = ${LOG_DIR}/app-${HOSTNAME}.log
log4perl.appender.Logfile.layout = Log::Log4perl::Layout::SimpleLayout
# --- 8< ----
This produces a file named
user@thishost var/log/my_perl_app $: ls
app-sub { use Sys::Hostname; return hostname }
Expected:
user@thishost var/log/my_perl_app $: ls
app-thishost.log