Well, have you tried doing just DateTime.Now.ToString() to see what it output?? Chances are good that it's using "/" characters. That character is illegal in a filename.
Do something more like
logname = DateTime.Now().ToString("ddMMyyyyHHmmss") & ".log"