logback.xml location inside of the application jar file

2,562 views
Skip to first unread message

Pope Xie

unread,
Oct 10, 2016, 11:33:48 AM10/10/16
to CDAP User
Hi,

   According to http://docs.cask.co/cdap/3.5.1/en/developers-manual/advanced/application-logback.html?highlight=logback, a logback.xml can be packaged into the jar file. The question is the logback.xml location inside of the application jar file. Should it be / or /resources.

Thanks

Pope Xie

Terence Yim

unread,
Oct 10, 2016, 12:06:29 PM10/10/16
to cdap...@googlegroups.com
Hi,

It should be just “/logback.xml”. If you use maven for your project, by default everything under “src/main/resources” will be copied inside the project jar at “/“.

Terence

--
You received this message because you are subscribed to the Google Groups "CDAP User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+...@googlegroups.com.
To post to this group, send email to cdap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cdap-user/33984216-0a02-4909-ab64-8c364dca84ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pope Xie

unread,
Oct 10, 2016, 1:31:21 PM10/10/16
to CDAP User
Terence,

   Thanks for your answer. I put it under /. The log file is created. But nothing wrote to the log file. 

Thanks

Pope Xie 

Terence Yim

unread,
Oct 10, 2016, 1:39:27 PM10/10/16
to cdap...@googlegroups.com
Hi,

Would you mind share how’s the content of the logbook.xml looks like?

Terence

Pope Xie

unread,
Oct 10, 2016, 2:25:37 PM10/10/16
to CDAP User
<configuration>

<!-- Disabling some chatty loggers. -->
<logger name="com.test" level="DEBUG" />


<appender name="ECOMP_DEBUG"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/home/cdap/logs/debug.log</file>
<encoder>
<pattern>%date{yyyy-MM-dd'T'HH:mm:ss,GMT-0}+00:00|%X{requestId}|%X{serviceInstanceId}|%-10t|%X{serverName}|%X{serviceName}|%X{instanceUuid}|%p|%X{severity}|%X{serverIpAddress}|%X{server}|%X{ipAddress}|%X{className}|%X{timer}|%m%n
</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<maxIndex>10</maxIndex>
<FileNamePattern>/home/cdap/logs/debug.log.%i</FileNamePattern>
</rollingPolicy>
<triggeringPolicy
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>128MB</maxFileSize>
</triggeringPolicy>
</appender>

<root level="DEBUG">
<appender-ref ref="ECOMP_DEBUG" />
</root>

</configuration>

Terence Yim

unread,
Oct 10, 2016, 2:37:11 PM10/10/16
to cdap...@googlegroups.com
Hi,

Does the directory "/home/cdap/logs/“ exists and writable by the container user on all nodes in the YARN cluster?

Terence

Pope Xie

unread,
Oct 11, 2016, 12:26:17 PM10/11/16
to CDAP User
Yes. The directory exists. And a debug.log was created in it. But the log file is 0 empty.

Terence Yim

unread,
Oct 13, 2016, 8:23:27 PM10/13/16
to CDAP User
Hi,

Are you able to access the container logs (stdout, stderr, program.log)? It might shows error if it is related to the logback configuration.

Terence

Rohit Sinha

unread,
Oct 17, 2016, 4:09:01 PM10/17/16
to CDAP User
Hello Pope, 
I just wanted to follow up with you to see if you got a chance to look into the container logs being accessible or not ? 

Looking forward to your reply. 

Thanks,
Rohit

Pope Xie

unread,
Oct 18, 2016, 9:06:27 AM10/18/16
to CDAP User
There is no container log file. The logger is in a CDAP service.


Thanks

Pope Xie

Terence Yim

unread,
Oct 18, 2016, 6:16:12 PM10/18/16
to CDAP User
Hi Pope,

Just to confirm, without the logback.xml inside the application jar, you see log files correctly under the container log directory (you'll found at least 4 files, stdout, stderr, program.log and gc.log.*), is that right. After you added the logback.xml file as you shown above to the "/logback.xml" location inside the application JAR, you don't get any log files under the path that you setup in the logback.xml, right? How about the container log directory, is there any file there?

Terence

rus...@cask.co

unread,
Nov 3, 2016, 2:05:00 PM11/3/16
to CDAP User
Hi Pope, Just checking to see if you were able to resolve this issue?

Thanks,
Russ

rus...@cask.co

unread,
Nov 7, 2016, 2:07:17 PM11/7/16
to CDAP User
Hi Pope, I'm marking this as resolved for now. Please let us know if there is anything else we can help you with.

Thanks,
Russ
Reply all
Reply to author
Forward
0 new messages