Looking for JPOS logback

80 views
Skip to first unread message

LengZai

unread,
Jun 8, 2017, 4:18:07 AM6/8/17
to jPOS Users


Any documentation talking about JPOS Logback ? I want to implement this in my project.

Tony Seng

unread,
Jun 8, 2017, 4:58:56 AM6/8/17
to jpos-...@googlegroups.com
Or SysLog Listener ?

On Thu, Jun 8, 2017 at 4:18 PM, LengZai <nick_s...@hotmail.com> wrote:


Any documentation talking about JPOS Logback ? I want to implement this in my project.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to a topic in the Google Groups "jPOS Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jpos-users/2X1V5f6--nk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jpos-users+unsubscribe@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/f8c90fce-5d18-486e-9d77-1cf3cb7bdb23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Whatever you are , be a good one.

Tony Seng

unread,
Jun 8, 2017, 5:34:30 AM6/8/17
to jpos-...@googlegroups.com

I want to send the JPOS Log to syslog using sysLogListener

@Override
public void setConfiguration(Configuration c) throws ConfigurationException {
try {
mux = QMUX.getMUX("mux.clientsimulator-mux");
} catch (NameRegistrar.NotFoundException ex) {
sysLogListener.log(createError()); // not printing in syslog
System.out.println(ex); // print in the console

}
}

But the log messege not appearing in syslog.

Tony Seng

unread,
Jun 8, 2017, 6:21:33 AM6/8/17
to jpos-...@googlegroups.com
Bump...

Alejandro Revilla

unread,
Jun 8, 2017, 3:18:23 PM6/8/17
to jPOS Users
In order to use the SysLogListener, you have to configure your logger like this (in 00_logger.xml):

<logger name="Q2" class="org.jpos.q2.qbean.LoggerAdaptor">
  <log-listener class="org.jpos.util.SysLogListener">
     <property name="facility" value="xx" />
     <property name="severity" value="5" />
     <property name="prefix" value="[jPOS]" />
     <property name="port" value="5514" />
  </log-listener>
</logger>

Then you use the logger in the standard way. If you class extends Log (to make things easier), you can just call

    warn(ex);

Please note that your call to QMUX.getMUX shouldn't use the "mux." prefix as that prefix is automatically added by QMUX.getMUX method. Just try QMUX.getMUX("clientsimulator-mux");

I would recommend that you get this running using the SimpleLogListener first, and once you get the output there, consider using syslog.



LengZai

unread,
Jun 8, 2017, 9:56:45 PM6/8/17
to jPOS Users
Hi, thanks for the reply. Should I add anything in pom.xml ?

在 2017年6月9日星期五 UTC+8上午3:18:23,Alejandro Revilla写道:
Reply all
Reply to author
Forward
0 new messages