Browse Source

Add LOG_FORMAT envvar to control logging format.

patch-2
Neil Booth 7 years ago
parent
commit
4ec85020f6
  1. 9
      docs/ENVIRONMENT.rst
  2. 5
      electrumx_server.py

9
docs/ENVIRONMENT.rst

@ -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**

5
electrumx_server.py

@ -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…
Cancel
Save