diff options
Diffstat (limited to '')
4 files changed, 128 insertions, 0 deletions
diff --git a/sandbox/slaws/logging/src/main/java/patha/Messages.properties b/sandbox/slaws/logging/src/main/java/patha/Messages.properties new file mode 100644 index 0000000000..857c767484 --- /dev/null +++ b/sandbox/slaws/logging/src/main/java/patha/Messages.properties @@ -0,0 +1,21 @@ +# +# +# 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. +# +# +TEST_MESSAGE = This is a test message with numbers {0}, {1}, {2} diff --git a/sandbox/slaws/logging/src/main/java/patha/SomeTuscanyClassA.java b/sandbox/slaws/logging/src/main/java/patha/SomeTuscanyClassA.java new file mode 100644 index 0000000000..ad29675074 --- /dev/null +++ b/sandbox/slaws/logging/src/main/java/patha/SomeTuscanyClassA.java @@ -0,0 +1,35 @@ +package patha;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+
+public class SomeTuscanyClassA {
+
+ private static final Logger Log = LogUtils.getL7dLogger(SomeTuscanyClassA.class);
+
+ public SomeTuscanyClassA() {
+
+
+ Integer params[] = {8, 9, 4};
+
+
+ LogUtils.log(Log,
+ Level.INFO,
+ "TEST_MESSAGE",
+ null,
+ (Object[])params);
+
+ Exception ex = new IllegalStateException("TEST_MESSAGE");
+
+ LogUtils.log(Log,
+ Level.INFO,
+ "TEST_MESSAGE",
+ ex,
+ (Object[])params);
+
+
+ }
+
+}
diff --git a/sandbox/slaws/logging/src/main/java/pathb/SomeTuscanyClassB.java b/sandbox/slaws/logging/src/main/java/pathb/SomeTuscanyClassB.java new file mode 100644 index 0000000000..5ad190d9c4 --- /dev/null +++ b/sandbox/slaws/logging/src/main/java/pathb/SomeTuscanyClassB.java @@ -0,0 +1,48 @@ +package pathb;
+
+import java.io.InputStream;
+import java.util.logging.Level;
+import java.util.logging.LogManager;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+
+import patha.SomeTuscanyClassA;
+
+public class SomeTuscanyClassB {
+ private static final Logger Log = Logger.getLogger(SomeTuscanyClassA.class.getName());
+
+
+ public SomeTuscanyClassB() {
+
+ Logger Log1 = Logger.getLogger("pathb", "tuscany-messages");
+ Logger Log = Logger.getLogger(SomeTuscanyClassB.class.getName());
+ String rbName = Log.getResourceBundleName();
+
+ Log.log(Level.INFO,
+ "MESSAGE1");
+
+
+ String componentName = "Some component";
+
+ Log.log(Level.INFO,
+ "MESSAGE2", // message id
+ componentName); // parameter
+
+ Integer params[] = {8, 9, 4};
+
+ Log.log(Level.INFO,
+ "MESSAGE3", // message id
+ params); // parameter
+
+
+ Exception ex = new IllegalStateException("TEST_MESSAGE");
+
+ Log.log(Level.INFO,
+ "MESSAGE4", // message id
+ ex); // parameter
+
+
+ }
+
+}
diff --git a/sandbox/slaws/logging/src/main/java/pathb/tuscany-messages_en.properties b/sandbox/slaws/logging/src/main/java/pathb/tuscany-messages_en.properties new file mode 100644 index 0000000000..523263da40 --- /dev/null +++ b/sandbox/slaws/logging/src/main/java/pathb/tuscany-messages_en.properties @@ -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. +# +# +MESSAGE1 = This is a test message with no params +MESSAGE2 = This is a test message with a string param {0} +MESSAGE3 = This is a test message with numbers {0}, {1}, {2} +MESSAGE4 = This is a test message with exception |