Change the line to this:
handler = SysLogHandler(address='/dev/log')
This works for me
import logging import logging.handlers my_logger = logging.getLogger('MyLogger') my_logger.setLevel(logging.DEBUG) handler = logging.handlers.SysLogHandler(address = '/dev/log') my_logger.addHandler(handler) my_logger.debug('this is debug') my_logger.critical('this is critical')
Related Posts:
- python exception message capturing
- How to easily print ascii-art text?
- No handlers could be found for logger
- TypeError: ‘NoneType’ object is not iterable in Python
- Relative imports – ModuleNotFoundError: No module named x
- ValueError: invalid literal for int() with base 10: ”
- What does the “yield” keyword do?
- How do I get the number of elements in a list?
- How do I list all files of a directory?
- TypeError: ‘int’ object is not callable
- Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
- ImportError: No module named pip
- Showing an image with pylab.imshow()
- Confused by python file mode “w+”
- How to make a flat list out of a list of lists
- Removing duplicates in lists
- Conda command not found
- Anaconda vs. miniconda
- No module named serial
- ImportError: No module named psycopg2
- DataFrame constructor not properly called
- How does functools partial do what it does?
- What does pythonic mean?
- Python strip with \n [duplicate]
- ImportError: Missing required dependencies [‘numpy’]
- Why is it string.join(list) instead of list.join(string)?
- How to prevent errno 32 broken pipe?
- How to iterate over rows in a DataFrame in Pandas
- How do I concatenate two lists in Python?
- if A vs if A is not None:
- TypeError: ‘function’ object is not subscriptable – Python
- How can I make an EXE file from a Python program?
- Python set to list
- ImportError: No module named ‘pygame’
- Split string with multiple delimiters in Python [duplicate]
- Getting key with maximum value in dictionary?
- ImportError: No module named PIL
- Error after upgrading pip: cannot import name ‘main’
- Django: ImproperlyConfigured: The SECRET_KEY setting must not be empty
- What is dtype(‘O’), in pandas?
- ctypes – Beginner
- Keras, how do I predict after I trained a model?
- How do I find out my PYTHONPATH using Python?
- ValueError: could not broadcast input array from shape (224,224,3) into shape (224,224)
- Overflow Error in Python’s numpy.exp function
- Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock
- Catch multiple exceptions in one line (except block)
- Python Finding Prime Factors
- ValueError: ‘object too deep for desired array’
- ‘int’ object has no attribute ‘__getitem__’
- AttributeError(“‘str’ object has no attribute ‘read'”)
- How to get an absolute file path in Python
- Restart python-script from within itself
- What does “TypeError ‘xxx’ object is not callable” means?
- How to create an array of bits in Python?
- Setting Django up to use MySQL
- How do I remove a substring from the end of a string?
- Selecting with complex criteria from pandas.DataFrame
- How can I download Anaconda for python 3.6
- django:django.core.exceptions.AppRegistryNotReady: Apps aren’t loaded yet
- Replace and overwrite instead of appending
- module ‘pandas’ has no attribute ‘rolling_mean’
- Displaying better error message than “No JSON object could be decoded”
- List attributes of an object [duplicate]
- How can I set the aspect ratio in matplotlib?
- Using __add__ operator with multiple arguments in Python
- How to constantly run Python script in the background on Windows?
- Django – “no module named django.core.management”
- Type error Unhashable type:set
- Saving a Numpy array as an image
- TypeError: ‘bool’ object is not callable
- How do I maximize the display screen in PyGame?
- Python: ValueError: Mixing iteration and read methods would lose data
- python: restarting a loop
- “for loop” with two variables?
- How to put the legend out of the plot
- Python string prints as [u’String’]
- How can I check the extension of a file?
- Matplotlib: TypeError: can’t multiply sequence by non-int of type ‘numpy.float64’
- NameError: global name ‘unicode’ is not defined – in Python 3
- Numpy – add row to array
- How to change pip installation path
- What is the difference between a string and a byte string?
- “This constructor takes no arguments” error in __init__
- plot a circle with pyplot
- TypeError: super() takes at least 1 argument (0 given) error is specific to any python version?
- ValueError: cannot switch from manual field specification to automatic field numbering
- How to serve static files in Flask
- How to create Gephi network graphs from Python?
- strncmp in python
- How can I count time in Python 3?
- Using strip() to clean up a string
- KeyError: ‘plotly_domain’
- The value of _stdout is incorrect
- Import file from parent directory?
- Virtualenv not compatible with this system or executable
- isPrime Function for Python Language
- str.translate gives TypeError – Translate takes one argument (2 given), worked in Python 2
- Run function from the command line
- alueError: ordinal must be >= 1