I need to log username in log file.
if we customise logging by editing log4j.properties, is it possible to add user defined properties in log4j to log username?
Discussion posts and replies are publicly visible
What do you mean with "I need to log username in log file"? Which event?
Typically event logging includes more than just a single attribute, along the lines of "Who" did "What" and "When" and maybe some "Context".
Also, logs shouldn't be considered as "Write only" data sinks. You need to consider who needs to access the content, why, when and how. Looking at this as a holistic feature you may find that you need more than just a write to the log4j file!
i can able to fetch the current user details using the function loggedinuser() and save in a constant variable. If i give access rights to some other user, they can able to access my application.
i need to save those user details like username, date time.
i want to write those details into log
So it's no big secret - you can write data to a database and you can view that data through an Appian user interface. So you can design your own logging solution to meet the requirements that you have, including multiple attributes per log entry, a single reusable mechanism for writing the log events, and a secure method of exposing that data to authorised users. No different to any other business application, just a whole lot simpler.