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 logger option to print timestamps in UTC for log traces #10

Closed
lisaong opened this issue Jan 20, 2017 · 1 comment · Fixed by #15
Closed

Add a logger option to print timestamps in UTC for log traces #10

lisaong opened this issue Jan 20, 2017 · 1 comment · Fixed by #15
Assignees

Comments

@lisaong
Copy link

lisaong commented Jan 20, 2017

Currently, the logger outputs timestamps (which are super useful for diagnosis), but they default to local time. 

When StoreBroker is used in conjunction with web applications, being able to output UTC timestamps will simplify correlating with other log sources that do the same.

@lisaong
Copy link
Author

lisaong commented Jan 24, 2017

Also noticed a typo in Helpers.ps1:
https://github.com/Microsoft/StoreBroker/blob/master/StoreBroker/Helpers.ps1#L391

    switch ($Level)
    {
        ...
        'Debug'   { Write-Degbug $ConsoleMessage }

@HowardWolosky HowardWolosky self-assigned this Jan 26, 2017
HowardWolosky pushed a commit that referenced this issue Jan 27, 2017
Write-Log is used for writing all messages to the console and the log file.
It embeds a timestamp with each message, but this timestamp uses LocalTime.
A request has come in to optionally allow users to have this timestamp
recorded in UTC instead of LocalTime.

This adds a new global variable $global:SBUseUTC that defaults to $false.
If set to $true, then Write-Log will use UTC for the timestamps, appending
a "Z" to the end of the timestamp based on http://www.w3.org/TR/NOTE-datetime.

The documentation has been updated to reflect this new
configuration option.

* Additionally fixed a typo in Write-Log where it was trying to
call Write-Debug.

Resolves #10: Add a logger option to print timestamps in UTC for log traces
HowardWolosky pushed a commit that referenced this issue Feb 7, 2017
Write-Log is used for writing all messages to the console and the log file.
It embeds a timestamp with each message, but this timestamp uses LocalTime.
A request has come in to optionally allow users to have this timestamp
recorded in UTC instead of LocalTime.

This adds a new global variable $global:SBUseUTC that defaults to $false.
If set to $true, then Write-Log will use UTC for the timestamps, appending
a "Z" to the end of the timestamp based on http://www.w3.org/TR/NOTE-datetime.

The documentation has been updated to reflect this new
configuration option.

* Additionally fixed a typo in Write-Log where it was trying to
call Write-Debug.

Resolves #10: Add a logger option to print timestamps in UTC for log traces
HowardWolosky added a commit that referenced this issue Feb 10, 2017
Write-Log is used for writing all messages to the console and the log file.
It embeds a timestamp with each message, but this timestamp uses LocalTime.
A request has come in to optionally allow users to have this timestamp
recorded in UTC instead of LocalTime.

This adds a new global variable $global:SBUseUTC that defaults to $false.
If set to $true, then Write-Log will use UTC for the timestamps, appending
a "Z" to the end of the timestamp based on http://www.w3.org/TR/NOTE-datetime.

The documentation has been updated to reflect this new
configuration option.

* Additionally fixed a typo in Write-Log where it was trying to
call Write-Debug.

Resolves #10: Add a logger option to print timestamps in UTC for log traces
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

Successfully merging a pull request may close this issue.

2 participants