cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with logger.debug in share js file

praveen_5685
Champ in-the-making
Champ in-the-making
Hi All,

logger.debug is not working in share get.js, when I tried to use logger.debug("some message"); I got the following error in the browser
TypeError: Cannot find function debug.

Please help me to resolve this issue.

Thanks in advance,
Badam.
11 REPLIES 11

ddraper
World-Class Innovator
World-Class Innovator
Which version of Alfresco and which browser?

praveen_5685
Champ in-the-making
Champ in-the-making
Hi,

I'm using Alfresco4.2.b(community edition) and firefox.

zladuric
Champ on-the-rise
Champ on-the-rise
Hi,

logger.debug() is a method on server-side javascript.

If you're trying to use logging in client side JS, you can use alfresco's logging:
Alfresco.logger.debug("message");
. Or simple old
console.log()
will work, but not in internet explorer.

zladuric
Champ on-the-rise
Champ on-the-rise
And on the server-side, I think you don't have
logger.debug()
. I think you can only have <code>logger.log()/code>, at least on the /share side of things. /alfresco app has them all: log(), debug(), error().

Thanks for ur reply Zlatko,

logger.debug() is working fine in server side webscripts, but I'm trying to use logger.debug() on presentation side webscrips (i.e, in sample.get.js ). It throwing error.

zladuric
Champ on-the-rise
Champ on-the-rise
Yes, use  Alfresco.logger.debug("message"); there.

ya i tried that in presentation webscript .js file but it's throwing same error message i.e, TypeError: Cannot find function debug.

ddraper
World-Class Innovator
World-Class Innovator
Maybe you could copy and paste in the code and the file it's in… there seems to be some confusion over whether you're trying to use WebScript controller logging code in client-side JavaScript or vice versa. Hopefully by providing this information we'll be able to identify the problem.

praveen_5685
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to use logger.debug("message"); in sample.get.js file i.e, on presentation webscript. Does logger.debug will work?