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 a log Header #8

Open
christophekumor opened this issue Jun 25, 2019 · 4 comments
Open

Add a log Header #8

christophekumor opened this issue Jun 25, 2019 · 4 comments

Comments

@christophekumor
Copy link

Param to add a header to the log file.

we'll have to define what we want in this header.

@lazywinadmin
Copy link
Collaborator

lazywinadmin commented Jun 25, 2019

in most case i see people use this to log the environment/context
Version of powershell, path of script, current user, etc...

I would keep the header and footer parsable. example

<datetime> <delimiter> <messagetype> <delimiter> <source><delimiter><message>
example:

2019/06/25.08:34:00UTC;INF;HEADER;Using PowerShell version: 6.2
2019/06/25.08:34:01UTC;INF;HEADER;current user: mydomain\lazywinadmin
2019/06/25.08:34:01UTC;INF;MAIN; define var....
2019/06/25.08:34:01UTC;INF;MAIN; connect to db
2019/06/25.08:34:01UTC;INF;MAIN; perform task
2019/06/25.08:34:01UTC;INF;MAIN; done
2019/06/25.08:34:01UTC;INF;FOOTER; script completed in 1sec

@LaurentLienhard
Copy link
Contributor

ok for a header but as proposed @lazywinadmin with the same format as the log itself.
I hate having a log with header, log then footer :-) like that

i don't like
Header
Using PowerShell version: 6.2
current user: mydomain\lazywinadminc

2019/06/25.08:34:01UTC;INF;MAIN; define var....
2019/06/25.08:34:01UTC;INF;MAIN; connect to db
2019/06/25.08:34:01UTC;INF;MAIN; perform task
2019/06/25.08:34:01UTC;INF;MAIN; done

Footer
script completed in 1sec

@omiossec
Copy link
Member

The main problem here is that we create a fixed format.
We should have a dynamic format or at least a format we can extend to use other log containers like Json, Win Event ...

@LaurentLienhard
Copy link
Contributor

LaurentLienhard commented Jul 16, 2019

as i said i don't like header and footer on log file so for me is not useful ;-)

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

No branches or pull requests

4 participants