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

Add overall output for aminer #288

Closed
landauermax opened this issue Nov 16, 2020 · 10 comments
Closed

Add overall output for aminer #288

landauermax opened this issue Nov 16, 2020 · 10 comments
Assignees
Labels
enhancement New feature or request
Projects

Comments

@landauermax
Copy link
Contributor

There should be a way to write everything that the AMiner outputs in a file. For example, in the beginning of the config, a parameter StandardOutput: "/etc/aminer/output.txt" can be set, where all the output (anomalies, errors, etc) is written to in addition to the usual output components. By default, it should be None and not write anything.

@landauermax landauermax added the enhancement New feature or request label Nov 16, 2020
@landauermax landauermax added this to To do in Aminer via automation Nov 16, 2020
@ernstleierzopf
Copy link
Contributor

Same as in issue #287 this can be handled with > or >> or 2> depending on the stream you want to redirect.
If you want both cases to be covered - printing to stdout and printing to file - you have to define two StreamPrinterEventHandlers and set the streams there.

@ernstleierzopf
Copy link
Contributor

Please close if you agree.

@landauermax
Copy link
Contributor Author

The problem is that output components do not write error messages, e.g., when the aminer crashes due to some bug, to the file, and > is not possible when the aminer is run as a service.

@ernstleierzopf
Copy link
Contributor

I think in that case the (debug) logfile provides or should provide (every error message should be checked again after all PR are accepted - there already exists an issue for that) the output errors. Error messages are logged at every log level.

@4cti0nfi9ure 4cti0nfi9ure moved this from To do to In progress in Aminer Nov 17, 2020
@landauermax
Copy link
Contributor Author

Does this include exceptions thrown by python? For example, there is an index out of bound exception in one of the detectors and we do not catch this exception, will the message end up in the aminer logfile?

@ernstleierzopf
Copy link
Contributor

It includes every catched error, but I think the answer is no. If the error is not catched, it is not logged.

@ernstleierzopf
Copy link
Contributor

However i think this is a common problem and should not be solved in code.
For systemd here is the answer - instead or additionally to StandardOutput you can also define StandardError. See here for the answer: https://unix.stackexchange.com/questions/408929/systemd-how-to-redirect-stdout-to-logfile

@ernstleierzopf
Copy link
Contributor

Where is the systemd service defined? Is it in the repository? If so i can make the changes.

@ernstleierzopf
Copy link
Contributor

ernstleierzopf commented Nov 18, 2020

Where is the systemd service defined? Is it in the repository? If so i can make the changes.

I have found it in source/root/lib/systemd/system.
StandardOutput is set to null. Is there a reason for this?
StandardError can also be defined to a specific file.

What file should be used by default (for both?)? /var/log/aminer/aminer.log?

@ernstleierzopf
Copy link
Contributor

We have discussed this and will implement it in the service configuration.

@ernstleierzopf ernstleierzopf mentioned this issue Nov 19, 2020
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Aminer
  
In progress
Development

No branches or pull requests

3 participants