Logging all calls for IceGrid node servers

cfrauenbergercfrauenberger Member Chris FrauenbergerOrganization: University of SussexProject: ECHOES II
Hello,

would there be an easy way to just log all calls from any client on servers of an IceGrid node into a file with a timestamp?

We use the default Logger for some stuff, but
a) I fail to be able to configure it so that it is properly redirected into a file (some output that is visible in the console just disappears, no matter how I configure Ice.StdErr, Ice.StdOut or IceGrid.Node.Output...)
and
b) it would be just better to have a general logging facility that is simply logging all calls made (not as low level as Ice.Protocol or Ice.Network...)

Many thanks,
Chris

PS: we use Ice-3.3.1 on Windows

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Chris,
    Hello,

    would there be an easy way to just log all calls from any client on servers of an IceGrid node into a file with a timestamp?

    We use the default Logger for some stuff, but
    a) I fail to be able to configure it so that it is properly redirected into a file (some output that is visible in the console just disappears, no matter how I configure Ice.StdErr, Ice.StdOut or IceGrid.Node.Output...)
    and

    You have in theory 2 options:
    • You set IceGrid.Node.Output to the location of a directory and each server stderr/stdout will be redirected to <server id>.out and <server id>.err files in this directory.
    • You set Ice.StdErr and Ice.StdOut in the IceGrid node configuration file to redirect the node stderr/stdout to files (this should also redirect the stderr/stdout of the servers).

    I'm not sure why it doesn't work for you, can you perhaps give us the steps to reproduce the problem (using the IceGrid demos for example)?
    b) it would be just better to have a general logging facility that is simply logging all calls made (not as low level as Ice.Protocol or Ice.Network...)

    There are several ways to intercept calls on the server side (using dispatch interceptors or blobjects for example) perhaps this is what you're looking for? You should provide more details on what exactly you need to log.

    Cheers,
    Benoit.
  • cfrauenbergercfrauenberger Member Chris FrauenbergerOrganization: University of SussexProject: ECHOES II
    Thanks Benoit for the quick reply.

    Attached the IceGrid node configuration file and the xml file defining the servers.

    I have managed to get the Ice.Logger messages appear in the server specific files using IceGrid.Node.Output. However, this only works on my Mac with Ice 3.4.1. Using Windows 7 and Ice 3.3.1 both files are empty using the exact same configuration and software... Could this be a bug in 3.3.1?

    As for general logging, I suppose what I would love is a way to simply log all calls from any client to any server on an IceGrid node (e.g., [timestamp - server.method, arguments, client_who_calls]) Ideally, without messing with the server code.

    Thanks again
    Chris
  • cfrauenbergercfrauenberger Member Chris FrauenbergerOrganization: University of SussexProject: ECHOES II
    Hello,

    I investigated further and it seems that the problem is related to how I start up icegridnode on Windows.

    So when I start it from a batch file with
    start %ICE_HOME%\bin\icegridnode.exe --Ice.Config=config/icegridnode-collocated.cfg

    then the stderr/stdout is not captured in the server file.

    When I don't start it as a background process, but directly in the console, then the output is there. Any idea why?

    Sorry, this seems more like a Windows problem then Ice. Thanks...
    Chris
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    No, it's not clear to me why it doesn't work when started from a batch file. Did you try to re-direct the node stderr/stdout to a file to see if it helped (using Windows command redirection operators)? Could you also try with the latest Ice version on Windows?

    Cheers,
    Benoit.
Sign In or Register to comment.