cancel
Showing results for 
Search instead for 
Did you mean: 

Logger

sanketgosavi
Champ in-the-making
Champ in-the-making
Where i can see this.alfLog(); mentioned in js files ?

Path : webapps\share\js\alfresco
4 REPLIES 4

hardik1512
Star Contributor
Star Contributor
Hello Sanket,

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.

Hope this helps.

sanketgosavi
Champ in-the-making
Champ in-the-making
Hi Hardik,

How to write content in log files?
As we have Logger.log("String") for alfresco.log or share.log

Thanks

rjohnson
Star Contributor
Star Contributor
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.

Purists may shout, but it works for me.

hardik1512
Star Contributor
Star Contributor
Hello Sanket,

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)