python - Save log files in the user home directory -
i have logging.conf [1] file configure logging in python application.
... [handler_file_log_handler] class=logging.handlers.timedrotatingfilehandler level=info formatter=simple args=('/var/log/myapp/myapp.log',)
as can see, i'm storing log file in /var/log/myapp directory.
what store in user (the user manages application) home directory (/home/myuser/.myapp/log). so, question is:
what should configure in logging.conf in order able save log file of python application in user home directory?
[1] - https://docs.python.org/2.6/library/logging.html#configuring-logging
the user's home directory can found (on os) using:
os.path.expanduser("~")
Comments
Post a Comment