Re: [PhillyPUG] Interesting issue writing to syslog

From: Gary D.
Sent on: Tuesday, September 10, 2013 12:08 PM
=> Has anyone run into issues writing to syslog? According to the 2.6.6
=> documentation:
=>
=> http://docs.pytho...­ <%22>
=>
=> We don't really care about Solaris, but just as an academic exercise, we
=> ran it there as well. Please see below: this runs fine on Mac, but not on
=> RHEL6 or Solaris. Any ideas?

   While the doc language is a bit inconsistent, it looks like the "ident"
argument is required.

>>> import syslog
>>> syslog.openlog("sysl­og")

   Good luck...

                                     Gary Duzan


=>
=> *SOLARIS:*
=>
=> [myuser@mysystem3 ~]$ python
=> Python 2.6.2 (r262:71600, Sep [masked], 06:31:01) [GCC 3.4.6] on sunos5
=> Type
=> "help", "copyright", "credits" or "license" for more information.
=>  >>> import syslog
=>  >>> syslog.openlog()
=> Traceback (most recent call last):
=>    File "<stdin>", line 1, in <module>
=> TypeError: ident string [, logoption [, facility]]  >>>
=> syslog.openlog(facil­ity = syslog.LOG_LOCAL6) Traceback (most recent call
=> last):
=>    File "<stdin>", line 1, in <module>
=> *TypeError: openlog() takes no keyword arguments*
=>
=> *RHEL6:*
=>
=> [myuser@mysystem-sas­3-dev-h ~]$ python
=> Python 2.6.6 (r266:84292, May[masked], 05:35:12) [GCC[masked] (Red
=> Hat 4.4.7-3)] on linux2 Type "help", "copyright", "credits" or "license"
=> for more information.
=>  >>> import syslog
=>  >>> syslog.openlog()
=> Traceback (most recent call last):
=>    File "<stdin>", line 1, in <module>
=> TypeError: ident string [, logoption [, facility]]  >>>
=> syslog.openlog(facil­ity = syslog.LOG_LOCAL6) Traceback (most recent call
=> last):
=>    File "<stdin>", line 1, in <module>
=> *TypeError: openlog() takes no keyword arguments*
=>
=> *MAC OS/X:*
=>
=> [myuser@aeonflux ~]$ python
=> Python 2.7.2 (default, Oct[masked], 20:14:37) [GCC 4.2.1 Compatible Apple
=> Clang 4.0 (tags/Apple/clang-41­8.0.60)] on darwin Type "help", "copyright",
=> "credits" or "license" for more information.
=>  >>> import syslog
=>  >>> syslog.openlog()
=>  >>> syslog.openlog(facil­ity = syslog.LOG_LOCAL6)
=>
=> Any help would be much appreciated. Hopefully it isn't a rookie mistake.
=>
=> Regards,
=>
=> -Tim
=>


Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy