You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2024/04/04 12:28:10 UTC

(logging-log4j-samples) branch main updated: Add custom configuration file to JLink example

This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j-samples.git


The following commit(s) were added to refs/heads/main by this push:
     new dd5790a  Add custom configuration file to JLink example
dd5790a is described below

commit dd5790a3f7c4d92e9ffb2699eb1ce3605156defb
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Thu Apr 4 14:28:03 2024 +0200

    Add custom configuration file to JLink example
---
 log4j-samples-configuration/pom.xml                |  5 +++++
 .../src/main/resources/log4j2.custom               | 24 ++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/log4j-samples-configuration/pom.xml b/log4j-samples-configuration/pom.xml
index 01e750a..20645b3 100644
--- a/log4j-samples-configuration/pom.xml
+++ b/log4j-samples-configuration/pom.xml
@@ -25,6 +25,11 @@
   <artifactId>log4j-samples-configuration</artifactId>
   <packaging>jar</packaging>
   <name>Apache Log4j Samples: Configuration</name>
+
+  <properties>
+    <bnd-module-name>org.apache.logging.log4j.samples.configuration</bnd-module-name>
+  </properties>
+
   <dependencies>
 
     <!-- Annotations -->
diff --git a/log4j-samples-jlink/src/main/resources/log4j2.custom b/log4j-samples-jlink/src/main/resources/log4j2.custom
new file mode 100644
index 0000000..943b243
--- /dev/null
+++ b/log4j-samples-jlink/src/main/resources/log4j2.custom
@@ -0,0 +1,24 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+##
+Dummy file to activate our custom configuration factory.
+
+Pass:
+
+-Dlog4j2.configurationFile=classpath:log4j2.custom --add-modules org.apache.logging.log4j.samples.configuration
+
+to the JVM arguments to use it.