Skip to content

Commit 879fde5

Browse files
committed
Updated README.md to refer to log4j version 2.7.
Also updated the sample app to use that for logging. Furthermore, switched to tomcat8 maven plugin.
1 parent be0debc commit 879fde5

File tree

3 files changed

+14
-119
lines changed

3 files changed

+14
-119
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ Again, we don't include dependencies to those implementation backends ourselves,
7171
<dependency>
7272
<groupId>org.apache.logging.log4j</groupId>
7373
<artifactId>log4j-slf4j-impl</artifactId>
74-
<version>2.4.1</version>
74+
<version>2.7</version>
7575
</dependency>
7676
<dependency>
7777
<groupId>org.apache.logging.log4j</groupId>
7878
<artifactId>log4j-core</artifactId>
79-
<version>2.4.1</version>
79+
<version>2.7</version>
8080
</dependency>
8181
```
8282

sample/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
A simple CF sample application that we cloned from [cloudfoundry-sticky-session](https://github.com/jbayer/cloudfoundry-sticky-session) and tweaked to provide a sample for the logging and instrumentation features.
66

7-
Currently configured to use `logback` as the logging implementation.
7+
Currently configured to use `log4j2` as the logging implementation.
88

99
## Running it locally
1010

1111
You can use the following Maven target to run the application locally
1212

1313
```sh
14-
mvn tomcat7:run
14+
mvn tomcat8:run
1515
```
1616

1717
Once the tomcat container has started, you can access the application via [http://localhost:8080/logging-sample-app](http://localhost:8080/logging-sample-app)

sample/pom.xml

Lines changed: 10 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</parent>
1212

1313
<properties>
14-
<tomcat.version>7.0.65</tomcat.version>
14+
<tomcat.version>8.0.39</tomcat.version>
1515
<log4j2.version>2.7</log4j2.version>
1616
<logback.version>1.1.3</logback.version>
1717
<jackson.version>2.5.4</jackson.version>
@@ -65,20 +65,20 @@
6565
<version>${project.version}</version>
6666
</dependency>
6767

68-
<!-- Use logback as the slf4j implementation -->
68+
<!-- LOGBACK dependencies (currently not used)
6969
<dependency>
7070
<groupId>com.sap.hcp.cf.logging</groupId>
7171
<artifactId>cf-java-logging-support-logback</artifactId>
7272
<version>${project.version}</version>
7373
</dependency>
74-
<dependency>
74+
<dependency>
7575
<groupId>ch.qos.logback</groupId>
7676
<artifactId>logback-classic</artifactId>
7777
<version>${logback.version}</version>
78-
</dependency>
79-
80-
<!-- LOG4J2 VERSION
78+
</dependency>
79+
-->
8180

81+
<!-- use log4j2 as the slf4j implementation -->
8282
<dependency>
8383
<groupId>com.sap.hcp.cf.logging</groupId>
8484
<artifactId>cf-java-logging-support-log4j2</artifactId>
@@ -94,121 +94,16 @@
9494
<artifactId>log4j-core</artifactId>
9595
<version>${log4j2.version}</version>
9696
</dependency>
97-
-->
97+
9898
</dependencies>
9999

100100
<build>
101101
<plugins>
102-
<!-- add mvn tomcat7:run, so we can easily test locally -->
102+
<!-- add mvn tomcat8:run, so we can easily test locally -->
103103
<plugin>
104104
<groupId>org.apache.tomcat.maven</groupId>
105-
<artifactId>tomcat7-maven-plugin</artifactId>
106-
<version>2.3-SNAPSHOT</version>
107-
<dependencies>
108-
<dependency>
109-
<groupId>org.apache.tomcat.embed</groupId>
110-
<artifactId>tomcat-embed-core</artifactId>
111-
<version>${tomcat.version}</version>
112-
</dependency>
113-
<dependency>
114-
<groupId>org.apache.tomcat</groupId>
115-
<artifactId>tomcat-util</artifactId>
116-
<version>${tomcat.version}</version>
117-
</dependency>
118-
<dependency>
119-
<groupId>org.apache.tomcat</groupId>
120-
<artifactId>tomcat-coyote</artifactId>
121-
<version>${tomcat.version}</version>
122-
</dependency>
123-
<dependency>
124-
<groupId>org.apache.tomcat</groupId>
125-
<artifactId>tomcat-api</artifactId>
126-
<version>${tomcat.version}</version>
127-
</dependency>
128-
129-
<dependency>
130-
<groupId>org.apache.tomcat</groupId>
131-
<artifactId>tomcat-jdbc</artifactId>
132-
<version>${tomcat.version}</version>
133-
</dependency>
134-
135-
<dependency>
136-
<groupId>org.apache.tomcat</groupId>
137-
<artifactId>tomcat-dbcp</artifactId>
138-
<version>${tomcat.version}</version>
139-
</dependency>
140-
141-
<dependency>
142-
<groupId>org.apache.tomcat</groupId>
143-
<artifactId>tomcat-servlet-api</artifactId>
144-
<version>${tomcat.version}</version>
145-
</dependency>
146-
147-
<dependency>
148-
<groupId>org.apache.tomcat</groupId>
149-
<artifactId>tomcat-jsp-api</artifactId>
150-
<version>${tomcat.version}</version>
151-
</dependency>
152-
153-
<dependency>
154-
<groupId>org.apache.tomcat</groupId>
155-
<artifactId>tomcat-jasper</artifactId>
156-
<version>${tomcat.version}</version>
157-
</dependency>
158-
159-
<dependency>
160-
<groupId>org.apache.tomcat</groupId>
161-
<artifactId>tomcat-jasper-el</artifactId>
162-
<version>${tomcat.version}</version>
163-
</dependency>
164-
165-
<dependency>
166-
<groupId>org.apache.tomcat</groupId>
167-
<artifactId>tomcat-el-api</artifactId>
168-
<version>${tomcat.version}</version>
169-
</dependency>
170-
171-
<dependency>
172-
<groupId>org.apache.tomcat</groupId>
173-
<artifactId>tomcat-catalina</artifactId>
174-
<version>${tomcat.version}</version>
175-
</dependency>
176-
177-
<dependency>
178-
<groupId>org.apache.tomcat</groupId>
179-
<artifactId>tomcat-tribes</artifactId>
180-
<version>${tomcat.version}</version>
181-
</dependency>
182-
183-
<dependency>
184-
<groupId>org.apache.tomcat</groupId>
185-
<artifactId>tomcat-catalina-ha</artifactId>
186-
<version>${tomcat.version}</version>
187-
</dependency>
188-
189-
<dependency>
190-
<groupId>org.apache.tomcat</groupId>
191-
<artifactId>tomcat-annotations-api</artifactId>
192-
<version>${tomcat.version}</version>
193-
</dependency>
194-
195-
<dependency>
196-
<groupId>org.apache.tomcat</groupId>
197-
<artifactId>tomcat-juli</artifactId>
198-
<version>${tomcat.version}</version>
199-
</dependency>
200-
201-
<dependency>
202-
<groupId>org.apache.tomcat.embed</groupId>
203-
<artifactId>tomcat-embed-logging-juli</artifactId>
204-
<version>${tomcat.version}</version>
205-
</dependency>
206-
<dependency>
207-
<groupId>org.apache.tomcat.embed</groupId>
208-
<artifactId>tomcat-embed-logging-log4j</artifactId>
209-
<version>${tomcat.version}</version>
210-
</dependency>
211-
</dependencies>
105+
<artifactId>tomcat8-maven-plugin</artifactId>
106+
<version>3.0-r1655215</version>
212107
</plugin>
213108
<plugin>
214109
<artifactId>maven-compiler-plugin</artifactId>

0 commit comments

Comments
 (0)