This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How do I add custom events to the M-Files event log?

I'm assuming we use VaultEventLogOperations.AddCustomEventEntry but there's no documentation or examples of how to use this?

  1. Can EvenType be any string?
  2. What's the schema for XmlData? Is it the one in C:\Program Files\M-Files\23.10.13060.5\Common\events.xsd ?
Parents
  • EventType can be any string, and the XmlData can be any format (there's no schema).  In fact, it can be a simple string as well if you want.

    This code:

    job.Vault.EventLogOperations.AddCustomEventEntry("test", "<hello></hello>");

    Produces this:

  • Hi Craig,

    Thx. What does it look like if non-xml is passed in

    E.x.: 

    ob.Vault.EventLogOperations.AddCustomEventEntry("test", "Hello World!");

  • Hi Hasani, 

    I am in meetings for much of today so may not have a chance to grab a screenshot. If you're near a machine then it may be quicker for you to test...?

    Craig.

  • Hi Craig,

    I would but I get the below error when I try to view entries in th event log.

    CoSnapIn.cpp, 561, This operation requires the Electronic Signatures and Advanced Logging module. (0x80040895)
    Item_Event.cpp, 657, This operation requires the Electronic Signatures and Advanced Logging module. (0x80040895)
    Item_Event.cpp, 709, This operation requires the Electronic Signatures and Advanced Logging module. (0x80040895)
    (M-Files 23.10.13060.5 2023-11-23T06:25:58.978Z)

Reply
  • Hi Craig,

    I would but I get the below error when I try to view entries in th event log.

    CoSnapIn.cpp, 561, This operation requires the Electronic Signatures and Advanced Logging module. (0x80040895)
    Item_Event.cpp, 657, This operation requires the Electronic Signatures and Advanced Logging module. (0x80040895)
    Item_Event.cpp, 709, This operation requires the Electronic Signatures and Advanced Logging module. (0x80040895)
    (M-Files 23.10.13060.5 2023-11-23T06:25:58.978Z)

Children
No Data