Not comparable to log4j, but with what you can start:
VBScript reusable login - LogToFile.vbs
In any place where you want to register a message in a script, you would simply add LogToFile "Your message" to register the relevant information.
With this script, you can record the date and time when you started the script, the date and time of the events, and generate unique file names if you want to schedule the script to run. It is also easy to disable logging without editing the entire log section.
If you want to write to the event log, you can do this using the WshShell object . It provides a LogEvent method for logging events in the application event log.
The LogEvent method allows you to log events from your scripts. LogEvent has two required parameters. The first parameter of the LogEvent method is an integer that indicates the type of event that you would like to write to the script log.
Set objShell = WScript.CreateObject("Wscript.Shell") objShell.LogEvent 0,"Test Success Event" objShell.LogEvent 1,"Test Error Event" objShell.LogEvent 2,"Test Warning Event" objShell.LogEvent 4, "Test Information Event" objShell.LogEvent 8, "Test Success Audit Event" objShell.LogEvent 16, "Test Failure Audit Event"
See here at Microsoft TechNet .
source share