Skip to content

Commit 58b2d94

Browse files
authored
Add test cases for messageFileName/traceFileName with TimedLogRollover (#32264)
logging FAT: Add TimedLogRollover tests for traceFileName/messageFileName Implements issue #32135 with 6 new FAT scenarios covering rollover behavior and dynamic config updates. Tests verify file creation/non-creation and rollover timing for traceFileName and messageFileName. Includes: - stdout vs trace.log behavior (bootstrap + server.xml) - Dynamic updates to trace.log and custom test.log - Dynamic update to custom message file - Verification of rollover at minute boundaries - Config update checks using console.log with 40s timeout Confirms existing bug from issue #31949 (traceFileName=stdout still produces trace.log) while providing regression coverage for future fixes.
1 parent 66795b5 commit 58b2d94

File tree

9 files changed

+571
-2
lines changed

9 files changed

+571
-2
lines changed

dev/com.ibm.ws.logging_2_fat/fat/src/com/ibm/ws/logging/fat/FATSuite.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*************************************************************************
2-
* Copyright (c) 2011, 2023 IBM Corporation and others.
2+
* Copyright (c) 2011, 2025 IBM Corporation and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License 2.0
55
* which accompanies this distribution, and is available at
@@ -23,7 +23,8 @@
2323

2424
@SuiteClasses({
2525
FfdcCleanupTest.class,
26-
TimeBasedLogRolloverTest.class
26+
TimeBasedLogRolloverTest.class,
27+
MessageTraceFileNameTimedRolloverTest.class
2728
})
2829

2930
public class FATSuite {

dev/com.ibm.ws.logging_2_fat/fat/src/com/ibm/ws/logging/fat/MessageTraceFileNameTimedRolloverTest.java

Lines changed: 434 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
Copyright (c) 2025 IBM Corporation and others.
3+
All rights reserved. This program and the accompanying materials
4+
are made available under the terms of the Eclipse Public License 2.0
5+
which accompanies this distribution, and is available at
6+
http://www.eclipse.org/legal/epl-2.0/
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
10+
Contributors:
11+
IBM Corporation - initial API and implementation
12+
-->
13+
<server description="Server for testing custom message file">
14+
<include location="../fatTestPorts.xml"/>
15+
16+
<featureManager>
17+
<feature>jsp-2.3</feature>
18+
</featureManager>
19+
20+
<logging
21+
traceSpecification="*=info:com.ibm.ws.kernel.*=all:com.ibm.ws.config.*=all"
22+
messageFileName="custom_message.log"/>
23+
</server>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
Copyright (c) 2025 IBM Corporation and others.
3+
All rights reserved. This program and the accompanying materials
4+
are made available under the terms of the Eclipse Public License 2.0
5+
which accompanies this distribution, and is available at
6+
http://www.eclipse.org/legal/epl-2.0/
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
10+
Contributors:
11+
IBM Corporation - initial API and implementation
12+
-->
13+
<server description="Server for testing dynamic -> test.log">
14+
<include location="../fatTestPorts.xml"/>
15+
16+
<featureManager>
17+
<feature>jsp-2.3</feature>
18+
</featureManager>
19+
20+
<logging
21+
traceSpecification="*=info:com.ibm.ws.kernel.*=all:com.ibm.ws.config.*=all"
22+
traceFileName="test.log"/>
23+
</server>
24+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
Copyright (c) 2025 IBM Corporation and others.
3+
All rights reserved. This program and the accompanying materials
4+
are made available under the terms of the Eclipse Public License 2.0
5+
which accompanies this distribution, and is available at
6+
http://www.eclipse.org/legal/epl-2.0/
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
10+
Contributors:
11+
IBM Corporation - initial API and implementation
12+
-->
13+
<server description="Server for testing dynamic stdout -> trace.log">
14+
<include location="../fatTestPorts.xml"/>
15+
16+
<featureManager>
17+
<feature>jsp-2.3</feature>
18+
</featureManager>
19+
20+
<logging
21+
traceSpecification="*=info:com.ibm.ws.kernel.*=all:com.ibm.ws.config.*=all"
22+
traceFileName="trace.log"/>
23+
</server>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!--
2+
Copyright (c) 2025 IBM Corporation and others.
3+
All rights reserved. This program and the accompanying materials
4+
are made available under the terms of the Eclipse Public License 2.0
5+
which accompanies this distribution, and is available at
6+
http://www.eclipse.org/legal/epl-2.0/
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
10+
Contributors:
11+
IBM Corporation - initial API and implementation
12+
-->
13+
<server description="Server for testing traceFileName=stdout">
14+
15+
<include location="../fatTestPorts.xml"/>
16+
17+
<featureManager>
18+
<feature>jsp-2.3</feature>
19+
</featureManager>
20+
21+
<!-- Enable real trace, but send it to stdout so no trace.log file is created/rolled -->
22+
<logging
23+
traceSpecification="*=info:com.ibm.ws.kernel.*=all:com.ibm.ws.config.*=all"
24+
traceFileName="stdout" />
25+
26+
</server>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
###############################################################################
2+
# Copyright (c) 2025 IBM Corporation and others.
3+
# All rights reserved. This program and the accompanying materials
4+
# are made available under the terms of the Eclipse Public License 2.0
5+
# which accompanies this distribution, and is available at
6+
# http://www.eclipse.org/legal/epl-2.0/
7+
#
8+
# SPDX-License-Identifier: EPL-2.0
9+
#
10+
# Contributors:
11+
# IBM Corporation - initial API and implementation
12+
###############################################################################
13+
bootstrap.include=../testports.properties
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
keystore_password=0701AzdnNz1ZrrZNQWIN0jL
2+
WLP_SKIP_MAXPERMSIZE=true
3+
WLP_LOGGING_ROLLOVER_START_TIME=00:00
4+
WLP_LOGGING_ROLLOVER_INTERVAL=1m
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!--
2+
Copyright (c) 2025 IBM Corporation and others.
3+
All rights reserved. This program and the accompanying materials
4+
are made available under the terms of the Eclipse Public License 2.0
5+
which accompanies this distribution, and is available at
6+
http://www.eclipse.org/legal/epl-2.0/
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
10+
Contributors:
11+
IBM Corporation - initial API and implementation
12+
-->
13+
<server description="Server for testing messageFileName/traceFileName with TimedLogRollover">
14+
15+
<include location="../fatTestPorts.xml"/>
16+
17+
<featureManager>
18+
<feature>jsp-2.3</feature>
19+
</featureManager>
20+
21+
</server>

0 commit comments

Comments
 (0)