The default handler is SysLogHandler <https://docs.python.org/3/library/logging.handlers.html#sysloghandler>, which uses a socket to communicate with syslogd, but there are lots of other handlers.
How about RotatingFileHandler <https://docs.python.org/3/library/logging.handlers.html#rotatingfilehandler>? Instructions are in the WeeWX wiki <https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging#logging-to-rotating-files>. NB: there is a bug in the WeeWX logging facility that prevents this handler from working if you specify options maxBytes and backupCount. If you want to use RotatingFileHandler, either avoid these two options, or use the patched weeutil.logger <https://raw.githubusercontent.com/weewx/weewx/master/bin/weeutil/logger.py> module. On Sun, May 17, 2020 at 11:35 AM Vince Skahan <[email protected]> wrote: > I'm running into adventures with v4 and docker images for the various os > due to the new logging setup. > > Typical example is starting v4 (rpm) up in a centos8 container: > > --- Logging error --- > Traceback (most recent call last): > File "/usr/share/weewx/weewx/engine.py", line 188, in run > for packet in self.console.genLoopPackets(): > File "/usr/share/weewx/weewx/drivers/simulator.py", line 148, in > genLoopPackets > time.sleep(sleep_time) > KeyboardInterrupt > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/usr/lib64/python3.6/logging/handlers.py", line 936, in emit > self.socket.send(msg) > OSError: [Errno 9] Bad file descriptor > > > On ubuntu-20.04 and debian-10 I worked around this by running rsyslogd > under supervisor, so I had two processes (syslog daemon and weewxd) running > in one container, which is kinda a hack. I haven't been able to get this > workaround working on centos7 or centos8 yet. > > In v4 is there any way to tell weewx to not log via sockets ? > > -- > You received this message because you are subscribed to the Google Groups > "weewx-development" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-development/bec06cb1-7b38-42e2-a99b-f5df871eba85%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-development/bec06cb1-7b38-42e2-a99b-f5df871eba85%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "weewx-development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/CAPq0zEDkXd2j98Vzv%3Dw6zJvn2REzNReCGMR25TvDByYD94dGtA%40mail.gmail.com.
