1

System Versions

What is currently running, system-wise, with this setup:

  • OpenFin Process Manager Version: RVM = 8.1.0.4
  • Node.js: v16.15.0
  • Windows 10
  • Angular Application with C# .NET backend

Problem:

Currently, all application logs are saved locally on users' computers instead of in a centralized location for review and debugging. I noticed in the OpenFin Documentation that there is a sendApplicationLog() method, but the documentation only explains the parameters the function takes. I tried running this method manually in an OpenFin instance, but I got no output. Is there more documentation on how OpenFin can send logs to a remote location or how to direct the logs to a specific destination?

  • Can OpenFin directly import these logs to a protected database?

  • Is there a good alternative to feeding everything in the console output to a consolidated location?

    • Attempts:
      • I tried using Angular's global error-catching feature to intercept any global errors, but it doesn't catch warnings.
      • Can a global errorHandler be adapted to handle warnings and info in addition to errors?

Thank you.

DalexYu
  • 13
  • 3

1 Answers1

0

OpenFin provide a service where application logs can be encrypted and uploaded to a remote location managed by OpenFin. You can then retrieve the logs using the Log Manager api.

There are two methods to activate this.

You can enable app log management in the application manifest

{
  "licenseKey": "contract_identifier",
  "startup_app": {
    "enableAppLogging": true,
    "logManagement": {
      "enabled": true, 
    }
  }
}

Or you can use the sendApplicationLog api you mention in your question.

Relevant OpenFin developer documentation can be found here:

https://developers.openfin.co/of-docs/docs/log-management

https://developers.openfin.co/of-docs/reference/get_api-v1-applications

USE FOLLOWING AT OWN RISK

There is an undocumented and unsupported feature that allows you specify an alternative location to send logs to.

Your application manifest would need to include this:

"logManagement": {
  "enabled": true,
  "url": "<YOUR_URL_ENDPOINT>"
}

OpenFin support would not be drawn on what RVM / Runtime versions this is available in, and you should consider the possibility it could be removed without warning in newer versions.

John Kennedy
  • 113
  • 1
  • 6
  • Hey John, Thanks for answering. I was able to find https://github.com/built-on-openfin/container-starter/tree/main/how-to/use-logging-apis from the openfin site which seems to say that it could be possible to reroute to an endpoint. At the end of this article it also seems like it would be possible to change locations: https://openfin.zendesk.com/hc/en-us/articles/360035376752-OpenFin-Logging-RVM-and-Runtime-Logs- . I was wondering if using this knowledge if it would be a good idea to forward it to something like an S3 bucket for log storage and retrieval and if you have any ideas. – DalexYu Jun 26 '23 at 19:20
  • Thats new(ish). Hasnt made it into OpenFins main docs yet and isnt mentioned in release notes so dont know what versions it is available in. It looks good from a quick glance and seems to suit your use case, I'll have a bit more of a look into it and update my answer to reflect this. thanks – John Kennedy Jun 27 '23 at 14:54
  • I followed the demo and I was able to get it to log to a local folder following basically what was displayed in the demo. I had that running on a separate application to just listen to a localhost port. Now I am porting it to work within the application using nestjs. I am very new to this overall, and I am having trouble knowing what type of API would be needed to redirect the log to something like AWS S3. It seems that OpenFin automatically sends a Post request to the URL specified in the manifest json with an appended /api/v1/logs. But I am not sure the specifics on what is in the payload. – DalexYu Jun 28 '23 at 17:19
  • I asked OpenFin support about this and they advised "This property is an undocumented feature", "an older feature" and "not officially supported" I'm not going to rely on it being available in future version, or stable where it is available, and don't recommend using it. – John Kennedy Jul 05 '23 at 13:45
  • Hey John, I ended up using the api endpoint method where I would specify /api/v1/logs, and Then I would intercept at that endpoint with a NestJS post listener. It was able to serve my purpose and take in the logs as a multipart form with a file stream. The body of each request also supports the methods like setApplogUsername and stuff. It is also interesting that support told you that because they directed me to that resource and told me what I did was good with the OpenFin RVM. I was wondering if I could edit your answer with the solution I was able to come up with. Thank you for your help. – DalexYu Jul 07 '23 at 13:14