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

Make log filenames configurable #103

Closed
bugy opened this issue Mar 9, 2018 · 3 comments
Closed

Make log filenames configurable #103

bugy opened this issue Mar 9, 2018 · 3 comments

Comments

@bugy
Copy link
Owner

bugy commented Mar 9, 2018

At the moment all the log files have the same pattern: script-user-date.log
It should be possible to change the pattern and date format.

(The issue is based on comments: #89 (comment) and #89 (comment))

@csphoenix1, welcome as a watcher

@bugy
Copy link
Owner Author

bugy commented May 6, 2018

Done.
Can be configured in conf.json file, example config:

  "logging": {
    "execution_date_format": "%y-%m-%d_%H-%M-%S",
    "execution_file": "$ID$DATE"
  }

Date format should be in python format: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior
File is a filename format with python templating https://docs.python.org/2.4/lib/node109.html
The following fields are supported:

  • ID - execution id
  • USERNAME - name from script-server Auth or Base 64 auth header
  • HOSTNAME - hostname, resolved from IP
  • IP - ip of the executing user
  • DATE - start time of the execution (in the date_format format)
  • AUDIT_NAME - main name of the executing user (one of username -> hostname -> ip)
  • SCRIPT - name of executed script

@bugy bugy added the resolved label May 6, 2018
@bugy
Copy link
Owner Author

bugy commented Jul 21, 2018

Hi @csphoenix1, did you have a chance to try it? Is there anything else I could change/improve regarding log naming?

@bugy bugy closed this as completed Aug 5, 2018
@csphoenix1
Copy link
Contributor

I @bugy, I can't test it for this moment because I'm in holidays but it's seems to be really good :)
I'll try to test it soon.
Thank's for this feature!
Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants