create log in python
logging.basicConfig(filename="logfilename.log", level=logging.INFO)
# Log Creation
logging.info('your text goes here')
logging.error('your text goes here')
logging.debug('your text goes here')
create log in python
logging.basicConfig(filename="logfilename.log", level=logging.INFO)
# Log Creation
logging.info('your text goes here')
logging.error('your text goes here')
logging.debug('your text goes here')
python logger exception
# Get Python error information with debug output
# logger.exception outputs a stack trace alongside the error message.
# Example
import logging
try:
1/0
except ZeroDivisionError:
logging.exception("error_log")
# Outputs
ERROR:root:error_log
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
ZeroDivisionError: integer division or modulo by zero
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us