在 Maven 中使用嵌入式模式时如何更改 browsermob-proxy 日志记录?
How to change browsermob-proxy logging when using the Embedded Mode with Maven?
我的 pom.xml 中包含 browsermob-proxy:
<dependency>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-proxy</artifactId>
<version>2.0.0</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
我在 browsermob-proxy 网站上看到一个讨论如何更改日志记录的部分 (https://github.com/lightbody/browsermob-proxy):
When running in stand-alone mode, the proxy loads the default logging configuration from the conf/bmp-logging.properties file. To increase/decrease the logging level, change the logging entry for net.lightbody.bmp.
然后我在 github (https://github.com/lightbody/browsermob-proxy/blob/master/browsermob-dist/src/main/config/bmp-logging.properties) 中看到一个属性文件,我可以更改它以获得我需要的日志记录,但我不确定如何更改此文件,或者在哪里找到它,因为我将它用作 Maven 依赖项。
BrowserMob Proxy 使用 slf4j 进行日志记录,因此当您 运行 处于嵌入式模式时,BMP 将使用您的应用程序使用的任何日志记录框架(log4j、logback、java util 日志记录等。 ).您确实需要为您的日志记录框架提供一个 slf4j 绑定——有关更多信息,请参阅 SLF4J FAQ 和手册。
设置应用程序的日志记录框架后,您可以像配置整个应用程序中的任何其他记录器一样配置 BMP 日志记录。 BMP 遵循使用完全限定 class 名称作为记录器名称的标准 Java 做法。
我的 pom.xml 中包含 browsermob-proxy:
<dependency>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-proxy</artifactId>
<version>2.0.0</version>
<exclusions>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
我在 browsermob-proxy 网站上看到一个讨论如何更改日志记录的部分 (https://github.com/lightbody/browsermob-proxy):
When running in stand-alone mode, the proxy loads the default logging configuration from the conf/bmp-logging.properties file. To increase/decrease the logging level, change the logging entry for net.lightbody.bmp.
然后我在 github (https://github.com/lightbody/browsermob-proxy/blob/master/browsermob-dist/src/main/config/bmp-logging.properties) 中看到一个属性文件,我可以更改它以获得我需要的日志记录,但我不确定如何更改此文件,或者在哪里找到它,因为我将它用作 Maven 依赖项。
BrowserMob Proxy 使用 slf4j 进行日志记录,因此当您 运行 处于嵌入式模式时,BMP 将使用您的应用程序使用的任何日志记录框架(log4j、logback、java util 日志记录等。 ).您确实需要为您的日志记录框架提供一个 slf4j 绑定——有关更多信息,请参阅 SLF4J FAQ 和手册。
设置应用程序的日志记录框架后,您可以像配置整个应用程序中的任何其他记录器一样配置 BMP 日志记录。 BMP 遵循使用完全限定 class 名称作为记录器名称的标准 Java 做法。