Link to home
Start Free TrialLog in
Avatar of Software Programmer
Software Programmer

asked on

Do we need to use MDC variable to append info to logger messages

Assume we have login controller where we identify user, company, session id, time etc.,

Now we want to add all these info by default in logger messages

Do we need to use MDC variable to put the key and values and log4j properties file needs to be defined as {sessionId}

MDC.put("sessionId", "121212");

Is this is the right approach or we need to do in a different way ?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Software Programmer
Software Programmer

ASKER

Thanks for the confirmation