Can't receive exception in Syslog using SyslogListener

67 views
Skip to first unread message

LengZai

unread,
Jun 9, 2017, 12:12:36 AM6/9/17
to jPOS Users
So I have added this in 00_logger.xml

<?xml version="1.0" encoding="UTF-8"?>
<logger name = "Q2" class = "org.jpos.q2.qbean.LoggerAdaptor">
 
<log-listener class="org.jpos.util.SysLogListener">
 
<property name="facility" value="21" />
 
<property name="severity" value="5" />
 
<property name="tags" value="audit, syslog" />
 
<property name="prefix" value="[jPOS]" />
 
<property name ="host" value ="localhost"/>
 
<property name ="port" value ="514"/>

 
<property name="syslog.facility" value="21" />
 
<property name="syslog.severity" value="5" />

 
<property name="audit.facility" value="21" />
 
<property name="audit.severity" value="4" />
 
</log-listener>
</logger>



In TestingMux.java, I extends to TransSupport, where the TransSupport extends to Log


@Override
public void setConfiguration(Configuration c) throws ConfigurationException {
 
try {
 mux
= QMUX.getMUX("clientsimulator-mux");
 
} catch (NameRegistrar.NotFoundException ex) {
 org
.jpos.util.Logger.getLogger(ex.toString());
 
System.out.println(ex);
 
}
}

I get org.jpos.util.NameRegistrar$NotFoundException: mux.clientsimulator-mux in IDE console, but nothing was print in syslog. What I have missed here ?

Sumeet Phadnis

unread,
Jun 9, 2017, 1:19:22 AM6/9/17
to jpos-...@googlegroups.com

You need to log the event and since TxnSupport extends Log, instead of org.jpos.util.Logger.getLogger(ex.toString()); just try using error(ex);


--
--
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 the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, 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/356ba2a2-525c-4d59-b295-30f9da49849b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

LengZai

unread,
Jun 9, 2017, 3:37:31 AM6/9/17
to jPOS Users
I tried, but I only see the error in the console, not in syslog. Anything I missed ?

在 2017年6月9日星期五 UTC+8下午1:19:22,Sumeet Phadnis写道:
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.

LengZai

unread,
Jun 9, 2017, 4:31:47 AM6/9/17
to jPOS Users
bump

在 2017年6月9日星期五 UTC+8下午3:37:31,LengZai写道:

Alejandro Revilla

unread,
Jun 9, 2017, 8:10:05 AM6/9/17
to jpos-...@googlegroups.com
What do you mean or try to achieve when you say "bump" to over 1000+ users in this list?

Please clarify before we get back to help you with your syslog issue.


For more options, visit https://groups.google.com/d/optout.
--

Andrés Alcarraz

unread,
Jun 9, 2017, 11:50:32 AM6/9/17
to jpos-...@googlegroups.com

Did you set a logger to your participant?

In you transaction participant xml definition you need to add the attributes logger="Q2" realm="some-identifying-string" so that the logger is assigned to your participant instance.

For example:

<participant class="your.package.TestingMux" logger="Q2" realm="testingmux-participant"/>

El 09/06/17 a las 05:31, LengZai escribió:

LengZai

unread,
Jun 13, 2017, 10:41:43 PM6/13/17
to jPOS Users
Thanks guys for the responses. I have solved it.  I change
org.jpos.util.Logger.getLogger(ex.toString());

to
error(ex)

, and add the error tag in
00_logger.xml

<property name="tags" value="audit, syslog,error" />

The problem solved.
Reply all
Reply to author
Forward
0 new messages