When you launch the Selenium Server with the -log option, it will automatically print lots of valuable debugging information out to a text file.
java -jar selenium-server.jar -log selenium.log
This log file is more verbose than the standard console logs (it includes DEBUG level logging messages). The log file also includes the logger name, and the ID number of the thread that logged the message. For example:
20:44:25 DEBUG [12] org.openqa.selenium.server.SeleniumDriverResourceHandler - Browser 465828/:top frame1 posted START NEW
The format here is:
TIMESTAMP LEVEL [THREAD] LOGGER - MESSAGE
Where TIMESTAMP is formatted as HH:mm:ss (24-hour time, no AM/PM necessary). Note that MESSAGE may be multi-line.
Browser-Side Logs
The Java implementation of the Selenium Server logs plenty of logging messages, but the JavaScript on the browser side (Selenium Core) also logs important messages; in many cases, these can be more useful to the end-user than the regular Selenium Server logs.
If you want access to browser-side logs, you'll need to pass the -browserSideLog argument to the Selenium Server, like this:
java -jar selenium-server.jar -browserSideLog
As a side effect, this will also make DEBUG level messages appear on the console.
-browserSideLog can also be combined with the -log argument, to log browserSideLogs (as well as all other DEBUG level logging messages) to a file. If you want ONLY browserSideLogs, you'll have to grep the log file for "browserSideLog".

Comments (3)
Apr 26, 2009
Tennis Smith says:
Where will these log files be? Will they show up immediately, or wil...Where will these log files be? Will they show up immediately, or will they only be created when active testing is in progress?
Dec 01
smholck says:
Tennis, if you follow the example above, the log file will be called "selenium.l...Tennis, if you follow the example above, the log file will be called "selenium.log" and will appear in the same directory that you executed the java command from. So if my current directory when I was executing the java command (using Win OS) is c:\test\, the file would be created as c:\test\selenium.log. You could specify a location by changing it to, for example,
java -jar selenium-server.jar -log c:\selenium.log
Dec 15
eric young says:
Can I set break point in java file and debug it? I am use build.xml.&n...Can I set break point in java file and debug it? I am use build.xml. Could you give some hints? Thanks