I have code that looks like this:
NDC.push("pid:#{$$}")
while true
begin
while task = get_task()
NDC.push("[#{task.id}]")
process_task1(task)
process_task2(task)
....
NDC.pop
end
rescue => e
NDC.clear
NDC.push "pid:#{$$}"
logger.error "blah"
sleep 60
end
end
I however, this doesn't appear to reset the NDC. It it gets an exception in the process_task functions, it just keeps
growing the NDC, which means I get log lines like:
2012-02-16 14:40:38 INFO pid:17760 [13675151] [13670651] [23412342] Message
which is not ideal. I've also tried NDC.remove, with no change. Any ideas?
Jeff |