There certainly are risks when you are writing files, but I don't see making a general rule of this. In the case of the flogger
node, the issue starts with the use of msg.filename
, which is shared with the core file
nodes and perhaps others. As suggested above, the risk of error could be reduced by instead using msg.logfile
(or better yet, msg.flogger.logfile
) for this property. Also, the node configuration allows the user to define a Log Dir
, which can help isolate any damage to that directory. I have used a strategy for overriding defaults that greatly reduces the chance of errors. I name properties that can be overridden as msg.nodename.property
, so that for flogger
the overrides object might be
msg.flogger = {
logfile: "mylog.log",
loglevel: "INFO"
};
The chance of a message accidentally carrying something like this into a flogger
node is very small, but the node could still have defaults configured to deal with the case where the message doesn't provide valid parameters.