You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,18 @@ The policies can still be overridden by setting them in `application.properties`
14
14
The default enforce policy can be disabled by enabling the `ExperimentalFeature.disableEnforceCsp` startup property.
15
15
16
16
## log4j2.xml
17
-
March 2025 brings a new implementation of log4j2.xml. We're now using the default configuration from the [server repo](https://github.com/LabKey/server/blob/develop/server/embedded/src/main/resources/log4j2.xml), and overriding that as needed with the local file identified in the `LOG4J_CONFIG_OVERRIDE` environment variable. By default this is an empty file that makes no changes, which is due to some complications of the Docker `COPY` command. During startup, entrypoint.sh copies the local files into the configs directory after the jar has been opened up.
17
+
March 2025 brings a new implementation of log4j2.xml. We're now using the default configuration from the [server repo](https://github.com/LabKey/server/blob/develop/server/embedded/src/main/resources/log4j2.xml), and overriding that as needed with the local file identified in the `LOG4J_CONFIG_OVERRIDE` environment variable. By default this is an empty file that makes no changes, which is due to some complications of the Docker `COPY` command. Any *.log4j2.xml files in the root dir will be copied to the config/ folder in the image when built, which end up in /labkey/config in a running container.
18
+
19
+
LabKey deployments use the included `labkey.log4j2.xml` to override the server default config, mostly just to set JSON format for console output.
20
+
21
+
Here are some example env var combinations and their effects:
| JSON_OUTPUT=true | uses `labkey.log4j2.xml` to set JSON format console output |
26
+
| LOG4J_CONFIG_OVERRIDE="labkey.log4j2.xml" | same as above |
27
+
| LOG4J_CONFIG_FILE="example.log4j2.xml" | assumes you built your own image with `example.log4j2.xml` in the root dir, and uses that instead of server defaults |
28
+
| LOG4J_CONFIG_FILE="example.log4j2.xml" LOG4J_CONFIG_OVERRIDE="labkey.log4j2.xml" | same as above, but also overrides `example.log4j2.xml` with contents of `labkey.log4j2.xml`|
18
29
19
30
## Upgrading from 23.11 to 24.3
20
31
March 2024 saw [many changes](https://github.com/LabKey/Dockerfile/commits/24.3.0) in an effort to bring this repo in line with LabKey server versioning/releases, starting with v24.3, in which the embedded tomcat version has been upgraded from 9 to 10.
echo"JSON_OUTPUT==true && LOG4J_CONFIG_FILE==log4j2.xml && LOG4J_CONFIG_OVERRIDE is set, so updating application.properties and log4j2.xml to output JSON to console"
227
+
# Check if we want JSON output, we are using the base log4j2.xml config
228
+
if [ "${JSON_OUTPUT}"="true" ] && [ "${LOG4J_CONFIG_FILE}"="log4j2.xml" ];then
229
+
echo"JSON_OUTPUT==true && LOG4J_CONFIG_FILE==log4j2.xml, so using the base log4j2.xml with labkey.log4j2.xml overrides, to send JSON output to console"
# if the override file exists and isn't empty, use that to override whatever was set in LOG4J_CONFIG_FILE (which might still be server default of log4j2.xml)
echo"saw JSON_OUTPUT=$JSON_OUTPUT and LOG4J_CONFIG_FILE=$LOG4J_CONFIG_FILE and LOG4J_CONFIG_OVERRIDE=$LOG4J_CONFIG_OVERRIDE"
238
+
echo"saw JSON_OUTPUT=$JSON_OUTPUT and LOG4J_CONFIG_FILE=$LOG4J_CONFIG_FILE and LOG4J_CONFIG_OVERRIDE=$LOG4J_CONFIG_OVERRIDE (which, if defined, was empty)"
0 commit comments