Hi, just spent 10 mins with your excellent new logging node. I like where its going and would like to give you some feedback and suggestions. I hope you dont mind.
Small issue - no time in log if only 'Local Time' selected
As there is no info on the side-bar for the config node, I assumed selecting Local Time (without selecting timestamp) would put local time in log - there was no time in logs (just a space). Perhaps "Local Time" should be disabled if "Timestamp" is not checked? (alternatively, a drop down to choose "none", "timestamp/UTC", "Local Time" etc might be worth considering)?
Additionally, when Local Time and Time Stamp are selected, the log time is presented in mm/dd/yyyy format & is not respecting the servers locale (I have it set for UK format).
Perhaps consider ISO format yyyy/mm/dd. This ISO format can never be confused and as a side bonus, is sort-able
Use typedInput
for log message
For the log message property, perhaps consider using a typed input that lets you choose msg. flow. global. and "full msg object". I feel that would be more flexible, intuitive and remove the need for users to put a change node before the flogger node when logging flow or global context.
msg
pass though
Would you consider permitting pass though of messages? (e.g. have an output on the flogger node so that messages can logged and simply pass through untouched). In-line logging if you will!
Reasoning...
When adding debug nodes / flogger nodes, we often have to branch off in the middle of a flow. This causes Node-RED to create clones of msg
& sometimes there are side effects.
Log Level
- Would you consider changing log level to the following common values...
- ERROR
- WARN
- INFO
- DEBUG
- TRACE
- Would you consider redefining the selected "log level" property as a default and allow the user to send an override this in
msg
(e.g. if msg.loglevel is null/undefined then use default, otherwise use msg.loglevel)
- Reasoning...
- One example - if I use a function node to
node.send()
debug/info/error messages to the log, I have no way of indicating its severity unless I have multiple function outputs and multiple flogger nodes.
Log Format options
Would you consider changing (or adding an option) to have all log entries as JSON similar to NLOG
e.g.
//logging msg.payload
{ "time": "2010-01-01 12:34:56.0000", "level": "ERROR", "message": "hello, world" }
//logging msg
{ "time": "2010-01-01 12:34:56.0000", "level": "ERROR", "message": {"topic": "Greeting", "payload": "hello, world"} }
Additional thoughts on NON JSON formatted logs...
How about permitting the user to use mustache formatting for "log msg"? Similar to the built in template node & http nodes?
This would permit a user to log something like Pinging {{payload.IPAddress}} responded with a TTL of {{payload.TTL}} - (Server name = {{computerName}})
Syslog
Have you considered adding "send to syslog"?
Not sure what would be involved but might be useful?
Stretch goal - a complete replacement for the built in debug node?
How about an option for "Send to debug side bar" and / or "Send to Console"?
Would be great to have a debug node that also logs to file