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:
|
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**
|
* **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**
|
* **NET**
|
||||||
|
|
||||||
|
|||||||
@ -18,9 +18,8 @@ from server.controller import Controller
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
'''Set up logging and run the server.'''
|
'''Set up logging and run the server.'''
|
||||||
logging.basicConfig(level=logging.INFO,
|
log_fmt = Env.default('LOG_FORMAT', '%(levelname)s:%(name)s:%(message)s')
|
||||||
format='%(asctime)s %(levelname)-7s %(message)-100s '
|
logging.basicConfig(level=logging.INFO, format=log_fmt)
|
||||||
'[%(filename)s:%(lineno)d]')
|
|
||||||
logging.info('ElectrumX server starting')
|
logging.info('ElectrumX server starting')
|
||||||
try:
|
try:
|
||||||
controller = Controller(Env())
|
controller = Controller(Env())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user