Hide third party jar logs from logback or properties file

主宰稳场 提交于 2019-12-25 04:46:11

问题


I am using Third Party jars which are appending their own logs in my Java Application's Log file , I don't want to append those third party logs in my log file as it makes log file very clumsy and confusing.

The logs are like -

`2016-11-03 12:59:41.910 ERROR 13586 --- [           main] o.h.j.i.metamodel.MetadataContext        : HHH015011: Unable to locate static metamodel field : org.openskye.domain.TaskQueue_#object_metadata_id
2016-11-03 12:59:41.913 ERROR 13586 --- [           main] o.h.j.i.metamodel.MetadataContext        : HHH015011: Unable to locate static metamodel field : org.openskye.domain.TaskQueue_#id
2016-11-03 12:59:41.914 ERROR 13586 --- [           main] o.h.j.i.metamodel.MetadataContext        : HHH015011: Unable to locate static metamodel field : org.openskye.domain.TaskQueue_#status
2016-11-03 12:59:41.914 ERROR 13586 --- [           main] o.h.j.i.metamodel.MetadataContext        : HHH015011: Unable to locate static metamodel field : org.openskye.domain.TaskQueue_#path

For hide the logs for the package available in my application I use

logging.level.package-name= INFO

but this is not work for the third party jar. Please help me

`


回答1:


You can set the rootLogger level to OFF and than set the logLevel for your base package to what ever you want, this leads to logging only for your classes.



来源:https://stackoverflow.com/questions/40396086/hide-third-party-jar-logs-from-logback-or-properties-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!