禁用dropwizard对特定资源的内部日志记录

时间:2015-01-12 13:08:23

标签: java dropwizard

我希望在将关键信息传递到某个资源(URL)时禁用日志记录。

1 个答案:

答案 0 :(得分:5)

您可以在.yml文件中基于每个类设置日志记录级别。例如,以下内容:

# Logging settings.
logging:

  # The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL.
  level: INFO

  # Logger-specific levels.
  loggers:

    # Overrides the levels of certain packages or files.
    "com.my.resources.User": OFF