Open gahujipo opened 4 years ago
Right now we cannot implement strucuterd logging (although I'd like it) cause the form Write-Log -Message 'Hello, {0}!' -Arguments 'Powershell'
uses powershell string formatting and doesn't work on named parameters (the {Who}
).
We need to write our custom string formatting to propagate the raw string down to the logging target.
@EsOsO How is the current status, I could add the feature next week.
Please go on, I didn't write anything yet.
Hey @tosoikea, have you been able to implement this?
I'd really like to use SEQ as logging target. It fails for every
Write-Log
command, because there is a problem in serializing the JSON, which I already fixed here: https://github.com/acsdatasystems/Logging/commit/c0980fa72b3275038638704edfc48c02310d6733 but haven't merged yet.With these changes, logs are coming to the SEQ server. But it seems, that there isn't implemented any structured logging. How can I get the original log message? E.g.
in that case I would need
Hello {0}!
instead ofHello PowerShell!
. I would need that, because I have to send a JSON to the server where the message cannot contain the value, but only a key and the value for that key somewhere else.The passed
$Log
variable doesn't seem to contain such a message template. Is there another way to get the original template?