mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-24 09:40:21 -06:00
Ensure requests to the web server hit the file log too.
This commit is contained in:
parent
53389d6ee0
commit
a0628f4a84
@ -31,17 +31,22 @@ app = Flask(__name__, static_url_path='')
|
|||||||
logging.addLevelName(25, 'SQL')
|
logging.addLevelName(25, 'SQL')
|
||||||
app.logger.setLevel(logging.DEBUG)
|
app.logger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
|
# We also need to update the handler on the webserver in order to see request
|
||||||
|
logger = logging.getLogger('werkzeug')
|
||||||
|
|
||||||
# File logging
|
# File logging
|
||||||
fh = logging.FileHandler(config.LOG_FILE)
|
fh = logging.FileHandler(config.LOG_FILE)
|
||||||
fh.setLevel(config.FILE_LOG_LEVEL)
|
fh.setLevel(config.FILE_LOG_LEVEL)
|
||||||
fh.setFormatter(logging.Formatter(config.FILE_LOG_FORMAT))
|
fh.setFormatter(logging.Formatter(config.FILE_LOG_FORMAT))
|
||||||
app.logger.addHandler(fh)
|
app.logger.addHandler(fh)
|
||||||
|
logger.addHandler(fh)
|
||||||
|
|
||||||
# Console logging
|
# Console logging
|
||||||
ch = logging.StreamHandler()
|
ch = logging.StreamHandler()
|
||||||
ch.setLevel(config.CONSOLE_LOG_LEVEL)
|
ch.setLevel(config.CONSOLE_LOG_LEVEL)
|
||||||
ch.setFormatter(logging.Formatter(config.CONSOLE_LOG_FORMAT))
|
ch.setFormatter(logging.Formatter(config.CONSOLE_LOG_FORMAT))
|
||||||
app.logger.addHandler(ch)
|
app.logger.addHandler(ch)
|
||||||
|
logger.addHandler(ch)
|
||||||
|
|
||||||
app.logger.debug('################################################################################')
|
app.logger.debug('################################################################################')
|
||||||
app.logger.debug('Starting pgAdmin 4...')
|
app.logger.debug('Starting pgAdmin 4...')
|
||||||
|
Loading…
Reference in New Issue
Block a user