You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by gi...@git.apache.org on 2017/08/12 01:09:44 UTC

[GitHub] rdhabalia commented on a change in pull request #680: Upgrade to log4j2 dependency and configuration

rdhabalia commented on a change in pull request #680: Upgrade to log4j2 dependency and configuration
URL: https://github.com/apache/incubator-pulsar/pull/680#discussion_r132806142
 
 

 ##########
 File path: conf/log4j2.xml
 ##########
 @@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+
+<Configuration status="INFO" monitorInterval="5" name="pulsar">
+
+	<!-- Example: This is a sample filter file: which can be added to appender to filter 
+				  logs based on the contextual-data
+	<Scripts>
+		  <ScriptFile name="filter.js" language="JavaScript"
+			path="/conf/log4j2-scripts/filter.js" charset="UTF-8" />
+	</Scripts>
+	-->
+	<Appenders>
+		<Console name="console" target="SYSTEM_OUT">
+			<PatternLayout
+				pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n" />
+		</Console>
+		<!-- Example: Rolling file appender to writes log into log file. Change the file-location 
+			          to appropriate path before using it
+		<RollingFile name="RollingFile" fileName="/pulsar-broker.log"
 
 Review comment:
   I commented it out because log4j tries to create that file on init even though we don't use that appender in the file anywhere.
   
   I will check if is there anyway to not to create the file.
   
   ```
   2017-08-11 18:08:09,417 main ERROR Unable to create file /pulsar-broker.log java.io.IOException: Permission denied
           at java.io.UnixFileSystem.createFileExclusively(Native Method)
           at java.io.File.createNewFile(File.java:1012)
           at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:409)
           at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:391)
           at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:73)
           at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:81)
   ```
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services