[back to the tutorial]
thanks Henrico Witvliet for this hint
you can instruct R to send its text to a logger using the function withCallingHandlers. combine this with options(warn=-1) and you have replaced the R built in warning logic with the logging package.
imagine you want all warnings in function F go to logger L, you use this construction:
try it with, for example, log(-1).
2010-11-03 09:24:04 WARNING:mylogger:simpleWarning in log(-1): NaNs produced