class_docstr: The default monitor implementation. It uses a logger to log data and schema, and will
  write monitor data to rotating files. The schema is logged as a JSON object, and the
  data is logged as a JSON array.
class_docstr_tok: ["The","default","monitor","implementation",".","It","uses","a","logger","to","log","data","and","schema",",","and","will","write","monitor","data","to","rotating","files",".","The","schema","is","logged","as","a","JSON","object",",","and","the","data","is","logged","as","a","JSON","array","."]
code: def _init_logger(self) -> None:
      if self.log_config_file is None:
          logging_config_yaml = DEFAULT_CONFIG_YAML
      else:
          with open(self.log_config_file, "r", encoding="utf8") as f:
              logging_config_yaml = f.read()
  
      worker_id = component_context.component_index or 0
      schema_path = Path(self.log_path).joinpath(
          self.name, "schema", f"schema.{worker_id}.log"
      )
      data_path = Path(self.log_path).joinpath(
          self.name, "data", f"data.{worker_id}.log"
      )
  
      schema_path.parent.mkdir(parents=True, exist_ok=True)
      data_path.parent.mkdir(parents=True, exist_ok=True)
  
      logging_config_yaml = logging_config_yaml.format(
          schema_filename=str(schema_path.absolute()),
          data_filename=str(data_path.absolute()),
          worker_id=worker_id,
          monitor_name=self.name,
      )
  
      try:
          logging_config = yaml.safe_load(logging_config_yaml)
      except yaml.YAMLError as e:
          raise ValueError(
              f"Error loading logging config from {self.log_config_file}: {e}"
          ) from e
  
      logging.config.dictConfig(logging_config)
      self.data_logger = logging.getLogger("bentoml_monitor_data")
      self.schema_logger = logging.getLogger("bentoml_monitor_schema")
  
file_path: BentoML/grpc-client/bentoml/_internal/monitoring/default.py
imports: from __future__ import annotations
  import collections
  import datetime
  import logging
  import logging.config
  import typing
  from pathlib import Path
  import yaml
  from ..context import component_context
  from ..context import trace_context
  from .base import MonitorBase
label_desc: Use image node_id 2 for calling the DefaultMonitor obj's underlying member method code with example usage: obj._init_logger() without return types