Add LOG_FORMAT envvar to control logging format.
This commit is contained in:
parent
60761b35e1
commit
4ec85020f6
@ -64,9 +64,16 @@ Miscellaneous
|
||||
|
||||
These environment variables are optional:
|
||||
|
||||
* **LOG_FORMAT**
|
||||
|
||||
The Python logging `format string
|
||||
<https://docs.python.org/3/library/logging.html#logrecord-attributes>`_
|
||||
to use. Defaults to `%(levelname)s:%(name)s:%(message)s`.
|
||||
|
||||
* **ALLOW_ROOT**
|
||||
|
||||
Set this environment variable to anything non-empty to allow running ElectrumX as root.
|
||||
Set this environment variable to anything non-empty to allow running
|
||||
ElectrumX as root.
|
||||
|
||||
* **NET**
|
||||
|
||||
|
||||
@ -18,9 +18,8 @@ from server.controller import Controller
|
||||
|
||||
def main():
|
||||
'''Set up logging and run the server.'''
|
||||
logging.basicConfig(level=logging.INFO,
|
||||
format='%(asctime)s %(levelname)-7s %(message)-100s '
|
||||
'[%(filename)s:%(lineno)d]')
|
||||
log_fmt = Env.default('LOG_FORMAT', '%(levelname)s:%(name)s:%(message)s')
|
||||
logging.basicConfig(level=logging.INFO, format=log_fmt)
|
||||
logging.info('ElectrumX server starting')
|
||||
try:
|
||||
controller = Controller(Env())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user