Page 1 of 1

How to customize the server-side session log

Posted: Fri Jan 30, 2015 5:07 am
by mou
Can I log the timestamp before/after a RPC call on the server side.
I know this can be done in the upper business layer.
What should I do if I want to log that in the lower layer uniformly for all business then?

Re: How to customize the server-side session log

Posted: Wed Mar 11, 2015 1:08 am
by jarl
Have you had a look at the logging support in RCFProto:

http://www.deltavsoft.com/RCFProto/doc/ ... gging.html

You can experiment with logging levels to find the level that suits you.

Re: How to customize the server-side session log

Posted: Thu Apr 16, 2015 9:56 am
by mou
Thanks, I saw that log.
The log format is not what I need.
And can I custom that format?
Actually, I use these logs not for debuging but for statistics of the service.
So, it's convenient for me if I can customize the fields in the log file.

Re: How to customize the server-side session log

Posted: Thu Apr 16, 2015 11:23 am
by jarl
The third parameter to enableLogging() is the log format string, which allows you to customize the fields that are printed to the log. I see we've missed documenting the format of that string, but here is a list of the format specifiers that are available:

%A: Log name
%B: Log level
%C: Time
%D: Thread id
%E: __FILE__
%F: __LINE__
%G: __FUNCTION__
%H: Time in ms since RCF initialization
%X: Log message

The default log format string is "%E(%F): [Thread: %D][Time: %H] %X" .

Hope that helps.