Show user id & screen in logged error message

Would it be possible to include the user id, and screen when error messages are logged?

For example, I found the following in the log:

18 Jul 2014 18:14:11,516 ERROR DialogErrorHandler,http-8080-13:68 - Failed to validate property Clinician: RP     is not valid for this field
18 Jul 2014 18:14:15,625 ERROR DialogErrorHandler,http-8080-13:68 - Failed to validate property Clinician: RP     is not valid for this field
18 Jul 2014 18:14:22,813 ERROR DialogErrorHandler,http-8080-13:68 - Failed to validate property Clinician: RP     is not valid for this field
18 Jul 2014 18:24:11,157 ERROR DialogErrorHandler,http-8080-13:68 - Failed to validate property Clinician: RP     is not valid for this field

This looks peculiar to me, RP is a clinician in our system.  However, because our users are terrible about reporting problems they encounter, I have to resort to broadcasting a message asking the person who enountered this error to contact me saying what they were doing.

If the log entry included the user id and some indication of what they were doing, it would be easier to investigate the problem.

Is there any useful information in the 'http-8080-13:68' ? If I look through the above log for 8080-13 I find:

18 Jul 2014 09:12:51,844  WARN LoggerListener,http-8080-13:60 - Authentication event InteractiveAuthenticationSuccessEvent: vs; details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffffc434: RemoteIpAddress: 192.168.2.101; SessionId: F5193B5924DB5E407790DB419AB731DC

Does this indicate that it was user VS who has the problem?

 

Regards, Tim G

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Show user id & screen in logged error message

As a postscript to the above problem, the user who had this problem spoke up, and I now understand what happened. Instead of entering 'RP' as the clinician, she typed 'RP ' - ie with a trailing space.

To make this type of error more visable in the future, I have adjusted the imobject.invalidreference entry in our messages.properties to read:

imobject.invalidreference      ''{0}'' is not valid for this field

Now, instead of the error message

Failed to validate property Clinician: RP  is not valid for this field

you get

Failed to validate property Clinician: 'RP ' is not valid for this field

One might argue that the code should always trim leading and trailing spaces from all data entered, but the above change to the message text is easy and also copes with other non printing characters (though I am not sure whether any characters other than space are possible).

Regards, Tim G

Syndicate content