kiwiirc/webircgateway

[Feature]: Allow wig logs to be ported on a file instead on console

westor7 opened this issue · 6 comments

Hello,

It would be nice to have an option under config to be able to place any wig log on a file.

Example:

# Log all outputs on a file
logFile = "/var/log/webircgateway.log"
  • Thanks!

It's available via "./webircgateway > /var/log/webircgateway.log"

I've actually been trying to fix this issue for months myself. I've tried this solution and many others over and over long before reading this today and thought it was just me.

For me starting WIG as suggested above, the logs still appear in the console and while a log file is created, it's always empty:

-rw-r--r-- 1 root root 0 Jul 31 23:36 webircgateway.log

Debian 9/WIG (about 3 months old). It was installed via git clone, GO. WIG works perfectly, but the lack of logs is a problem I can't seem to fix.

Any suggestions would be really welcome. Thank you.

@know75 this is how it's done in the official installer packages to create the /var/log/* files too. I'm not sure why your shell would be acting differently.

Thank you so much for your reply @prawnsalad.

It really does seem to be something on my end. I've tried a 100 Google searches to try and log to a file from the console. They all pretty much lead to @westor7's solution (which I use often for other applications), and you're doing in the offical packages. Maybe I messed something in the Go path, but WIG works perfectly. Anyway, thanks for taking the time to respond.

Actually it seems @know75 here is right. (using Ubuntu 20.04)

I tried to use ./webircgateway > /var/log/webircgateway.log too but it doesn't write anything on the log file in realtime, everything is output on console, even if i kill the webircgateway it doesn't write anything there either.

I still recommend for a better handle configurable addition about this, like:

# Log all outputs on a file
logFile = "/var/log/webircgateway.log"

@westor7, If you find an answer, please let me know.

If would most definitely be more elegant to have a file for logging to be specified within the config file.