Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling logging output from custom apps installed in a TOM #1083

Open
2 tasks
rachel3834 opened this issue Oct 17, 2024 · 3 comments
Open
2 tasks

Handling logging output from custom apps installed in a TOM #1083

rachel3834 opened this issue Oct 17, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@rachel3834
Copy link
Contributor

My TOM includes custom applications used to analyze data on my Targets, in this case fitting a model to a Target lightcurve.
The app outputs its own logs, normally storing them to disk when run stand alone.
I would like for the TOM to store this logging output so that I can make it available through the UI.
The TOM already uses Python's logging module to capture log streams, which can be viewed in a Cloud deployed-TOM via stern.

  • Question 1: I need my app to be able to run in stand alone mode and write to local disk as well as output to the TOM's log stream, if available. What is the best-practice way of writing the app to do achieve this?
  • Question 2: My app spawns parallelized subprocesses as part of its operation (one per Target), each of which write their own logs. I would like to store the output from this log in my TOM for UI display, without the user needing to resort to stern. The controller process produces a separate, additional log, which ideally I would also like to be able to view. How do you recommend we achieve this?
@rachel3834 rachel3834 added enhancement New feature or request question Further information is requested labels Oct 17, 2024
@github-project-automation github-project-automation bot moved this to Triage in TOM Toolkit Oct 17, 2024
@jchate6
Copy link
Contributor

jchate6 commented Oct 21, 2024

What sort of output (quantity mostly) are you expecting and how would you like it displayed?

@rachel3834
Copy link
Contributor Author

rachel3834 commented Oct 21, 2024 via email

@jchate6 jchate6 moved this from Triage to Backlog in TOM Toolkit Oct 25, 2024
@jchate6 jchate6 moved this from Backlog to Triage in TOM Toolkit Oct 25, 2024
@jchate6
Copy link
Contributor

jchate6 commented Oct 25, 2024

I think one strategy would be:

  1. Set up a django model to keep track of your analysis runs. This could have foreign keys to a target, or whatever fields you need, but importantly also includes a FileField for log output.
  2. Pipe any logs or output for the run into a file that is connected to the run model.
  3. have a run detail page that displays (or downloads) the log file.

This would be good for larger logs that are specific to a single use case. capturing general logs or logs that are only a few lines of text should probably be handled in a different way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
Status: Backlog
Development

No branches or pull requests

3 participants