Topic
  • 6 replies
  • Latest Post - ‏2013-04-19T07:56:03Z by M Groeneweg
ENO2010
ENO2010
134 Posts

Pinned topic RBD 8.5.1 - tracking information

‏2013-04-18T11:36:56Z |

Hi,

 

The sysLib.audit() system function writes tracking information to the system log or journal in a COBOL environment.

in a Java environment audit function doesn't work. Which EGL instruction do I need to use to get the same result.

 

regards

 

Eric

Updated on 2013-04-18T11:37:03Z at 2013-04-18T11:37:03Z by ENO2010
  • markevans
    markevans
    2807 Posts

    Re: RBD 8.5.1 - tracking information

    ‏2013-04-18T15:20:38Z  

    Eric,

    From the EGL Helps, it states that syslib.audit is not supported in Java or JavaScript.

     

    Java™ generation sysLib.audit() is not supported.
    JavaScript generation sysLib.audit() is not supported.

     

    To do something equivalent, you will need to use an external type to access a native java logging function, using writeStdout/writeStdErr to write to stdout or stderr, or write to a serial file in some kind of common function/logging library that you create.

  • TuukkaIlomäki
    TuukkaIlomäki
    68 Posts

    Re: RBD 8.5.1 - tracking information

    ‏2013-04-18T19:17:01Z  

    We use log4j in our Java environment and we are very happy with it. If you write EGL headers for it, it is easy to call logging functions from EGL code.

  • ENO2010
    ENO2010
    134 Posts

    Re: RBD 8.5.1 - tracking information

    ‏2013-04-19T06:15:35Z  

    We use log4j in our Java environment and we are very happy with it. If you write EGL headers for it, it is easy to call logging functions from EGL code.

    thank you for the feedback.

    I already investigate the log4j framework and it seems to be a solution but there is a major difference between log4j and syslib.audit.

    syslib.audit accepts a parameter a basic record which is an easy way to log the full content of a record.

    this functionality doesn't exist with log4j :-(

    my goal was to found a simple way to replace the current syslib.audit by somethingelse.

     

    Eric

  • M Groeneweg
    M Groeneweg
    80 Posts

    Re: RBD 8.5.1 - tracking information

    ‏2013-04-19T07:27:14Z  
    • ENO2010
    • ‏2013-04-19T06:15:35Z

    thank you for the feedback.

    I already investigate the log4j framework and it seems to be a solution but there is a major difference between log4j and syslib.audit.

    syslib.audit accepts a parameter a basic record which is an easy way to log the full content of a record.

    this functionality doesn't exist with log4j :-(

    my goal was to found a simple way to replace the current syslib.audit by somethingelse.

     

    Eric

    You can always use XMLLib to convert your record to XML and dump that in the log. We use that a lot and it proves really useful.

  • ENO2010
    ENO2010
    134 Posts

    Re: RBD 8.5.1 - tracking information

    ‏2013-04-19T07:49:33Z  

    You can always use XMLLib to convert your record to XML and dump that in the log. We use that a lot and it proves really useful.

    nice. do you have a sample?

    thanks

     

    Eric

  • M Groeneweg
    M Groeneweg
    80 Posts

    Re: RBD 8.5.1 - tracking information

    ‏2013-04-19T07:56:03Z  
    • ENO2010
    • ‏2013-04-19T07:49:33Z

    nice. do you have a sample?

    thanks

     

    Eric

    The convertToXML function accepts any EGL record and returns the XML string. (Not a DOM document, just the string) So you can use writeStdOut or any logger to log the XML string. If you want to log an array, put the array in a record first as you cannot pass an array to the function.

     

    xmlString string = XMLLib.convertToXML(myRecVar);

    // Do your logging with xmlString