0

I am sorry to ask, as it is not the first time, but I have not been able to fix it my self by looking at older posts.

Im trying to create and write to a logfile using python. I am creating the file just fine, but there is no input to the file that I am making.

here is my code:

import logging

log_file = '/home/user/Test.log'

form = "%(asctime)s - %(levelname)s - %(message)s"

logging.basicConfig(filename=log_file, filemode='w', level=logging.DEBUG , format=form)

logging.debug = ('DEBUG MESSAGE!')
1
  • Did you try changing your logging level to a more higher priority one? Commented Sep 5, 2017 at 8:03

1 Answer 1

2

Well you need to change:

logging.debug = ('DEBUG MESSAGE!')

to

logging.debug('DEBUG MESSAGE!')

This way it should work!

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a million!
@LasseBøg Welcome!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.