Add username (from JSF app) to the log

28 views
Skip to first unread message

Erick de Oliveira Leal

unread,
Aug 24, 2016, 12:45:04 AM8/24/16
to p6spy...@googlegroups.com
Hello, I have a requirement on a project to add the name of user (that comed from JSF session) beside of query.
Is this possible?
I use Wildfly default log stuff.

I'm from Brazil, sorry for bad english.

Felix B

unread,
Aug 24, 2016, 3:33:58 AM8/24/16
to p6spy users
Hi there,
in the upcoming 3.0.0-alpha-2, you can extend LoggingEventListener, override logElapsed and log any information you like. Another option would be to use the Slf4JLogger and put the username in the MDC (http://www.slf4j.org/api/org/slf4j/MDC.html).

--
You received this message because you are subscribed to the Google Groups "p6spy users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to p6spy-users...@googlegroups.com.
To post to this group, send email to p6spy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/p6spy-users/CALG1dwppgufiSvo43ETH4S%2BTxCR-9t1Eo7QtRmWXM5ohV5rkYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

erickdeol...@gmail.com

unread,
Aug 24, 2016, 9:48:34 AM8/24/16
to p6spy users
Great, could you provide an example how it could be done with 3 alpha 2? It's very important for us.

Erick de Oliveira Leal

unread,
Jan 5, 2017, 4:41:25 PM1/5/17
to p6spy users
Hello, could someone help me with this?

butk...@gmail.com

unread,
Jan 5, 2017, 5:49:03 PM1/5/17
to p6spy users
Hi, it might depend on logging framework you use. But I'd recommend checking concept of MDC (for problem similar to yours have a look at: http://veerasundar.com/blog/2009/10/log4j-mdc-mapped-diagnostic-context-what-and-why/ )

--
You received this message because you are subscribed to the Google Groups "p6spy users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to p6spy-users+unsubscribe@googlegroups.com.

To post to this group, send email to p6spy...@googlegroups.com.

Erick de Oliveira Leal

unread,
Jan 13, 2017, 10:15:16 AM1/13/17
to p6spy users
So I should download p6spy code with logelapsed, modify as I need and build a jar for my project?


Em quarta-feira, 24 de agosto de 2016 04:33:58 UTC-3, Felix B escreveu:
Reply all
Reply to author
Forward
0 new messages