I'm trying to add content of variable "log_location" to current logger.
log_location = log_folder_location + os.path.sep + log_file_name
logger.debug("log location", str(log_location))
print "log_location: ",log_location
this prints to console, but gives error in logging,
Traceback (most recent call last):
File "/usr/lib64/python2.6/logging/__init__.py", line 784, in emit
msg = self.format(record)
File "/usr/lib64/python2.6/logging/__init__.py", line 662, in format
return fmt.format(record)
File "/usr/lib64/python2.6/logging/__init__.py", line 444, in format
record.message = record.getMessage()
File "/usr/lib64/python2.6/logging/__init__.py", line 314, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
it prints to,
log_location: /U01/Nova/Logs/DEV-INT/TEST/validation_20170203-164617-5.log
This error is not happening in when I try in normal python prompt but facing same when using Flask
I've tried Logging Python stdout to File... with active stdout (backspacing/updating) and TypeError: not all arguments converted during string formatting python and this one too Python: Logging TypeError: not all arguments converted during string formatting
But did not understand what to do. Can someone explain this using simpler language, not like the documentation?