On my side,  I configured  a separate log file (/var/log/weewx.conf) and 
rotation by simply adding a [Logging] stanza in weewx.conf file - 
see https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging - without 
changing anything else in the OS logging configuration.

Here is the stanza I use :

[Logging]
    version = 1
    disable_existing_loggers = False
    
    # Root logger
    [[root]]
        level = {log_level}
        handlers = rotate,
    
    # Additional loggers would go in the following section. This is useful 
for tailoring logging
    # for individual modules.
    [[loggers]]
    
    # Definitions of possible logging destinations
    [[handlers]]
        
        # Log to a set of rotating files    
        [[[rotate]]]
            level = DEBUG
            formatter = verbose
            class = logging.handlers.RotatingFileHandler
            filename = /var/log/weewx.log
            maxBytes = 10000000
            backupCount = 4
        
        # Log to console
        [[[console]]]
            level = DEBUG
            formatter = verbose
            class = logging.StreamHandler
            # Alternate choice is 'ext://sys.stderr'
            stream = ext://sys.stdout
    
    # How to format log messages
    [[formatters]]
        [[[simple]]]
            format = %(levelname)s %(message)s
        [[[standard]]]
            format = {process_name}[%(process)d] %(levelname)s %(name)s: 
%(message)s
        [[[verbose]]]
            format = %(asctime)s  {process_name}[%(process)d] %(levelname)s 
%(name)s: %(message)s
            # Format to use for dates and times:
            datefmt = %Y-%m-%d %H:%M:%S



Le mercredi 16 août 2023 à 20:36:54 UTC+2, messyp...@gmail.com a écrit :

> https://github.com/weewx/weewx/wiki/logging
> Followed the instr above and while it's probably the best so far, my 
> current server, Linux OPI5B 5.10.110-rockchip-rk3588 #1.0.2 SMP Thu Apr 13 
> 16:55:55 CST 2023 aarch64 aarch64 aarch64 GNU/Linux, running ubuntu jammy 
> server (22.04), is up to date and I've been reading that the system 
> maintainers have changed the security on logrotate and even following the 
> instructions logrotate complained and wouldn't rotate until I set tighter 
> security on /var/log.  Currently the default user has to sudo to view 
> syslog, and I changed that by adding myself to the adm group. But there are 
> other problems that needed tightening up. 
> So when someone says something like "logs are a problem with the operating 
> system and are outside weewx" (something like that), they're right. PITA.
> Thanks. 
> Here are the links I read up on this about:
>
> https://stackoverflow.com/questions/52743279/uwsgi-log-rotation-gets-error-parent-directory-has-insecure-permissions
> https://github.com/rodjek/puppet-logrotate/issues/50
>
> https://stackoverflow.com/questions/55915275/error-ignoring-etc-logrotate-conf-because-it-is-writable-by-group-or-others
> (I think my problems were solved, at least on this install, by issuing 
> "sudo chmod 755 -R /var/log")
>
> On Wednesday, August 16, 2023 at 7:00:20 PM UTC+2 messyp...@gmail.com 
> wrote:
>
>> "sudo systemctl restart rsyslogd"  ... there is no process rsyslogd. 
>> There is a rsyslog. restarted that, but not working. I really don't want to 
>> have to take a short course on darned system logging for my new ubuntu 
>> 22.04 running on a orangepi5b. Oh well.
>> Thanks for trying to help. 
>>
>> On Friday, July 7, 2023 at 3:46:07 AM UTC+2 vince wrote:
>>
>>> Impossible to know what you did from your skeletal description, but this 
>>> worked for me on debian12 using the beta of v5 pip.
>>>
>>>    - wget 
>>>    
>>> https://raw.githubusercontent.com/weewx/weewx/master/util/rsyslog.d/weewx.conf
>>>  
>>>    -O /tmp/weewx-rsyslogd.conf
>>>    - sudo cp /tmp/weewx-rsyslogd.conf /etc/rsyslog.d/weewx.conf
>>>    - sudo systemctl restart rsyslogd
>>>    - sudo systemctl restart weewx
>>>    
>>> Be careful in the first step to wget the file and output to something 
>>> 'other' than weewx.conf to protect yourself from accidentally overwriting 
>>> your actual weewx config file.   As long as the file in /etc/rsyslog.d ends 
>>> in .conf it will work.
>>>
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/f2b3292f-0987-4f7f-ba72-2f165c5f4ca4n%40googlegroups.com.

Reply via email to