How to customize the server-side session log

RCFProto support and general discussion.
Post Reply
mou
Posts: 19
Joined: Fri Sep 26, 2014 7:53 am

How to customize the server-side session log

Post 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?

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: How to customize the server-side session log

Post 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.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

mou
Posts: 19
Joined: Fri Sep 26, 2014 7:53 am

Re: How to customize the server-side session log

Post 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.

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: How to customize the server-side session log

Post 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.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

Post Reply