gearpump-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jiang Weihua <whji...@outlook.com>
Subject Re: Configuring logging for selected application
Date Wed, 13 Jul 2016 01:33:52 GMT
Hi Karol,

There is some hard coding for how app logging (executor) is collected. The reason to do so
is to ensure we can correctly application log in a proper way as executors are in standalone
JVMS. You can check the LogUtil class for more details.

Thanks
Weihua

发件人: Vincent Wang <fvunicorn@gmail.com>
答复: <user@gearpump.incubator.apache.org>
日期: 2016年7月12日 星期二 上午11:39
至: <user@gearpump.incubator.apache.org>
主题: Re: Configuring logging for selected application

Actually we have not tested this scenario, I think all the related code is in org.apache.gearpump.util.LogUtil


2016-07-11 21:17 GMT+08:00 Karol Brejna <karolbrejna@apache.org<mailto:karolbrejna@apache.org>>:
I had problems configuring a Gearpump application logging.

I was trying to configure sending the logs to logstash, but it
shouldn't matter - I was not able to force new log4j config on the
app.

To reproduce:
1. https://github.com/gearpump/gearpump-java-example was used as a
test app (with some logging added)

2. the following config file was added so after compilation it was
accessible in the classpath:
{code}
log4j.rootLogger=info,tcp

log4j.appender.tcp=org.apache.log4j.net.SocketAppender
log4j.appender.tcp.Port=3456
log4j.appender.tcp.RemoteHost=localhost
log4j.appender.tcp.ReconnectionDelay=10000
log4j.appender.tcp.Application=playground
{code}

3. gearpump was ran using bin/local on localhos, logstash configured
to receive connections on port 3456 on localhost

4. after deploying the app (that contains log4.properties), no logs
are sent to logstash
("normal" log files are created and written).

The config was tested with standalone java app to be sure that
app->logstash communication works.

Also, adding similar config to conf/log4j.properties and runing gearpump worked:

{code}
# The application logger setting
gearpump.application.logger=ApplicationLogAppender, tcp

...

log4j.appender.tcp=org.apache.log4j.net.SocketAppender
log4j.appender.tcp.Port=3456
log4j.appender.tcp.RemoteHost=localhost
log4j.appender.tcp.ReconnectionDelay=10000
log4j.appender.tcp.Application=playground
{code}

Logs from every app deployed to gearpump was sent to logstash.

What is the proper way to configure logging on per app basis?

Mime
View raw message