[issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work

2022-03-04 Thread Philip Bloom


Philip Bloom  added the comment:

> Do you mean just adding a note to the effect that SysLogHandler won't work on 
> macOS 12.2 because of changes to the syslog daemon on that platform?

Yes or removing the specific guidance about OSX handling on it, mostly just to 
reduce folks coming to ask as they transition to it.  That way it comes off 
that you need to provide a Syslog consumer to use the handler/not to expect one 
to exist on the platform.  Hope I'm phrasing that understandably.

--

___
Python tracker 
<https://bugs.python.org/issue46914>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work

2022-03-03 Thread Philip Bloom


Philip Bloom  added the comment:

I could certainly understand that.  It's a weird apple choice.  

If so, then it probably good to adjust 
https://docs.python.org/3/library/logging.handlers.html#sysloghandler since it 
still talks about it being expected.

--

___
Python tracker 
<https://bugs.python.org/issue46914>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work

2022-03-03 Thread Philip Bloom


New submission from Philip Bloom :

Hello, don't file these often so apologies for any mistakes, trying to be good 
python citizen here.

Checked this on the python-list first, and others reported it as reproducible.

The issue is:
On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work.  It won't 
throw any error but the ASL/Console.App does not see any messages from it.  On 
OSX Big Sur (11.x) this works just fine with the exact same code.

I think I've cut this into a small example proof that can be run to demonstrate 
the issue.  If this is run and any of the substrings are searched for in 
Console.App when it is checking events, only the QQQ message from SysLog will 
show up.

Gonna work around it likely on our end, but hope this helps it get fixed for a 
future version.

---

import logging
from logging.handlers import SysLogHandler

root_logger = logging.getLogger()
root_logger.setLevel(logging.DEBUG)
basic_datefmt = '%m/%d/%Y %I:%M:%S %p'

syslog_format = logging.Formatter(fmt='SetupCDNGUI: %(message)s', 
datefmt=basic_datefmt)

sys_handler = SysLogHandler(address='/var/run/syslog')
#sys_handler.encodePriority(SysLogHandler.LOG_USER, SysLogHandler.LOG_ALERT)
# Tried with the above, but didn't make a difference.  Neither did not defining 
the address and letting it go to local host.
sys_handler.setFormatter(syslog_format)
root_logger.addHandler(sys_handler)


# None of these will show up.
logging.critical("CCC This is a test critical")
logging.error("EEE This is a test error")
logging.info("III Still a test")


# Comparatively this sends a message received just fine
import syslog

syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_USER)
syslog.syslog(syslog.LOG_NOTICE, 'QQQ test log')

--
components: macOS
messages: 414464
nosy: ned.deily, pbloom, ronaldoussoren
priority: normal
severity: normal
status: open
title: On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46914>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com