To view this logs, you need to enable client debug mode. For this set the client-debug element to true, <client-debug>true</client-debug> in share-config-custom.xml file and restart server. You will see Debug menu item on main menu header. Then ensure that the Debug Logging and Show All Logs items are selected. Then open any debugging tool(firebug for firefox or Chrome development tools) and refresh page. You should now see the logs.
You control writing to the log using the log4j .properties and then logger.log, logger.debug and logger.error. If I am writing Javascript webscripts then I tend to leave the log4j settings unchanged and use logger.error to write debug messages until I am happy everything is working & then I remove them. I do this because if you turn on debugging on the javascript engine then you get loads of messages from every script that runs and you can find it hard to see your own messages.
You can use alfresco/services/ErrorReporter service in your widget to POST client side errors to server. This service in-turn calls a JAVA-backed webscript which uses logger.error to log errors. So the logs should be in same file(share.log)