Skip to content

Commit

Permalink
add graylog logging instantiation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tzole1155 committed Jan 4, 2024
1 parent 0975dcd commit 0d1f6f0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions moai/conf/engine/modules/hydra_logging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @package engine.modules._name_

_target_: moai.engine.modules.HydraLogging
# hyu: ${hydra:hydra_logging}
job: ${hydra:job_logging}
19 changes: 19 additions & 0 deletions moai/engine/modules/hydra_logging.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# instantiate hydra logging for torchserve
import omegaconf.omegaconf
import typing
import logging



class HydraLogging(object):
def __init__(
self,
# hyu: typing.Dict = None,
job: omegaconf.DictConfig = None,
):
# NOTE: this is a workaround for the fact that torchserve
# does not support hydra logging
#
print(f"Hydra logging: {job}")
# Applying the logging configuration
logging.config.dictConfig(omegaconf.OmegaConf.to_container(job, resolve=True))

0 comments on commit 0d1f6f0

Please sign in to comment.