Skip to content
This repository was archived by the owner on Jul 26, 2023. It is now read-only.

promote browser mob, and fix logs duplication #13

Merged
merged 4 commits into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ When you build the latest code from source, you'll have access to the latest sna
<dependency>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-core</artifactId>
<version>2.1.18-SNAPSHOT</version>
<version>2.1.19-SNAPSHOT</version>
<scope>test</scope>
</dependency>
```
2 changes: 1 addition & 1 deletion browsermob-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.18-SNAPSHOT</version>
<version>2.1.19-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
public class HarCaptureFilter extends HttpsAwareFiltersAdapter {
private static final Logger log = LoggerFactory.getLogger(HarCaptureFilter.class);
private static final ThreadLocal<StatsDClient> statsDClient = new InheritableThreadLocal<>();
private static final ThreadLocal<Boolean> isAlreadyLoggedIn = InheritableThreadLocal.withInitial(() -> false);

/**
* The currently active HAR at the time the current request is received.
Expand Down Expand Up @@ -776,14 +777,15 @@ public void serverToProxyResponseReceived() {
}

private void logFailedRequestIfRequired(HarRequest request, HarResponse response) {
if (response.getStatus() >= 500 || response.getStatus() == 0) {
if (!isAlreadyLoggedIn.get() && (response.getStatus() >= 500 || response.getStatus() == 0)) {
MDC.put("caller", "mobproxy");
MDC.put("http_response_code", String.valueOf(response.getStatus()));
MDC.put("http_host", request.getUrl());
MDC.put("request_details", BeansJsonMapper.getJsonString(request));
MDC.put("method", request.getMethod());
MDC.put("response", BeansJsonMapper.getJsonString(response));
log.error("received bad status code");
isAlreadyLoggedIn.set(true);
}
}

Expand Down
2 changes: 1 addition & 1 deletion browsermob-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.18-SNAPSHOT</version>
<version>2.1.19-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion browsermob-dist/src/main/resources/bmp-logging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ configuration:
pattern: "[%-5level %date{ISO8601} %c{1}] %msg %xThrowable%n"
gelf:
- name: gelf
host: tcp:graylog-input.staging.hellofresh.io
host: tcp:localhost
port: 12204
filterStackTrace: true
mdcProfiling: true
Expand Down
2 changes: 1 addition & 1 deletion browsermob-legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.18-SNAPSHOT</version>
<version>2.1.19-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion browsermob-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.18-SNAPSHOT</version>
<version>2.1.19-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion mitm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.18-SNAPSHOT</version>
<version>2.1.19-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
18 changes: 2 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-proxy</artifactId>
<version>2.1.18-SNAPSHOT</version>
<version>2.1.19-SNAPSHOT</version>
<modules>
<module>browsermob-core</module>
<module>browsermob-legacy</module>
Expand Down Expand Up @@ -46,20 +46,7 @@
<url>git@github.com:lightbody/browsermob-proxy.git</url>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<repository>
<id>central</id>
<name>artifactory-artifactory-0-releases</name>
<url>https://artifactory.tools-k8s.hellofresh.io/artifactory/maven</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>artifactory-artifactory-0-snapshots</name>
<url>https://artifactory.tools-k8s.hellofresh.io/artifactory/maven</url>
</snapshotRepository>
</distributionManagement>


<pluginRepositories>
<pluginRepository>
<id>bintray</id>
Expand Down Expand Up @@ -195,7 +182,6 @@
<artifactId>littleproxy</artifactId>
<version>1.1.3</version>
<packaging>jar</packaging>
<pomFile>${basedir}/resources/jar/littleproxy-1.1.3.pom</pomFile>
</configuration>
<goals>
<goal>install-file</goal>
Expand Down
Loading