fabiolb / fabio

Consul Load-Balancing made simple
https://fabiolb.net
MIT License
7.25k stars 619 forks source link

How to configure log file output path #781

Closed xu644629187 closed 3 years ago

xu644629187 commented 4 years ago
How to configure log file output path
nathanejohnson commented 4 years ago

fabio.properties has documentation about logging. Specifically:

# log.access.target configures where the access log is written to.
#
# Options are 'stdout'. If the value is empty no access log is written.
#
# The default is
#
# log.access.target =
xu644629187 commented 4 years ago

fabio.properties has documentation about logging. Specifically:

# log.access.target configures where the access log is written to.
#
# Options are 'stdout'. If the value is empty no access log is written.
#
# The default is
#
# log.access.target =

It seems that stdout only controls whether the log is output, but it cannot set the control log print path, such as > > / APP / test / log, and automatic log cutting

nathanejohnson commented 4 years ago

are you deploying on a distribution using systemd by any chance?

xu644629187 commented 4 years ago

are you deploying on a distribution using systemd by any chance?

Yes, I started it with SYSTEMd

nathanejohnson commented 4 years ago

If you are using rsyslog, you can use something like this:

$template fabioOut,"%rawmsg%\n"
if $programname == 'fabio' then /var/log/fabio;fabioOut
& stop
nathanejohnson commented 3 years ago

closing due to inactivity