How to Customize the Q2 Log?

81 views
Skip to first unread message

Aswin Sundar

unread,
May 22, 2025, 3:39:40 AMMay 22
to jPOS Users
Hi Team,
Good Afternoon

In the Q2 log,
whatever we put in context will show all the content in the logs.
We only need to print the specific content in the log.

For Example:
Context ctx = (Context) context;

ISOMsg m = ctx.get(SS_REQUEST);
String pin = m.getString(52);
ctx.put(PIN, pin);

String ksn = m.getString(53);
ctx.put(KSN, ksn);

In the Current Q2 Log File:
PIN: 1234
KSN: 1234567890

We want to print only the KSN, others should not print in the log file.

Expected Q2 Log File:
KSN:1234567890


Thanks & Regards,
Aswin Sundar

chhil

unread,
May 22, 2025, 6:19:56 AMMay 22
to jpos-...@googlegroups.com

Disclaimer: This email may contain confidential, proprietary and/or privileged information belonging to Skilworth Technologies Private Limited. If you are not the intended recipient or authorized to receive it, you are strictly prohibited from using, copying, forwarding, disclosing, or taking any action based on this email or its contents. If you have received this email in error, please notify the sender immediately by replying to this email and delete it from your system. Recipient by anyone other than the intended recipient shall not be deemed a waiver of any privilege or protection. We do not represent or warrant in any way that this communication is free of malicious software or potentially damaging defects. You agree not to misuse any personally identifiable information contained in this email and shall comply with all applicable laws while handling such personally identifiable information. We expressly disclaim all liability for any actual or alleged loss, damage, or injury arising out of or resulting in any way from the receipt. Further, the Company has initiated actions for improving the environment and proactively undertakes business in accordance with industry standard Environment, Social, and Governance practices.

--
--
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+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jpos-users/634067db-6def-4ece-855f-e1ba237da2ecn%40googlegroups.com.

Aswin Sundar

unread,
May 23, 2025, 3:35:50 AMMay 23
to jPOS Users
Hi Chhil,

Thanks for the information.

In ProtectedLogListener, protect or wipe based on the Field ID.

But I need to remove the specific context object. Like below.


For Example:
Context ctx = (Context) context;

ISOMsg m = ctx.get(SS_REQUEST);
String pin = m.getString(52);
ctx.put(PIN, pin);

String ksn = m.getString(53);
ctx.put(KSN, ksn);

In the Current Q2 Log File:
PIN: 1234
KSN: 1234567890

We want to print only the KSN, others should not print in the log file.

Expected Q2 Log File:
KSN:1234567890


Thanks & Regards,
Aswin Sundar

Mark Salter

unread,
May 23, 2025, 3:55:27 AMMay 23
to jpos-...@googlegroups.com
Write your own Participant.  If the one provided doesn't do exactly what you need, then your own can do exactly what you need it to.

-- 
Mark

signature.asc

chhil

unread,
May 23, 2025, 4:00:53 AMMay 23
to jpos-...@googlegroups.com
Exactly, you customize it. Any participant will have access to the context, remove what you don't need from it at a point where further access to it is not needed. 

-chhil

Andrés Alcarraz

unread,
May 23, 2025, 7:27:08 AMMay 23
to jPOS Users
You can prepend your hidden keys with a ., and they will not be logged, IIRC

----
Enviado desde mi móvil, disculpas por la brevedad.

Sent from my cellphone, I apologize for the brevity.

Andrés Alcarraz.

chhil

unread,
May 23, 2025, 11:51:32 AMMay 23
to jpos-...@googlegroups.com
Good to know, wasn't aware of that. Since which version has this been available? 

-chhil

Alejandro Revilla

unread,
May 23, 2025, 8:32:25 PMMay 23
to jpos-...@googlegroups.com
That feature has been there for a loong time, started in 1.9.1 with an '*' but it was too OS/400ish and we changed to a Unix-like dot.



Reply all
Reply to author
Forward
0 new messages