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 logginglog_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!')
Mirza Obaid's user avatar
Mirza Obaid
1,7173 gold badges23 silver badges36 bronze badges
askedSep 5, 2017 at 7:58
Lasse Bøg's user avatar
1
  • Did you try changing your logging level to a more higher priority one?CommentedSep 5, 2017 at 8:03

1 Answer1

2

Well you need to change:

logging.debug = ('DEBUG MESSAGE!')

to

logging.debug('DEBUG MESSAGE!')

This way it should work!

answeredSep 5, 2017 at 8:04
Szabolcs's user avatar
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a million!
@LasseBøg Welcome!

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.