where does logger.log write to?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2012 06:06 AM
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2012 07:04 AM
Hello,
logger.log logs to the org.alfresco.repo.jscript.ScriptLogger in Log4J configuration. By default, this will land in catalina.out and alfresco.log, if DEBUG level is enabled.
Regards
Axel
logger.log logs to the org.alfresco.repo.jscript.ScriptLogger in Log4J configuration. By default, this will land in catalina.out and alfresco.log, if DEBUG level is enabled.
Regards
Axel

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2012 07:30 AM
In ./tomcat/webapps/share/WEB-INF/classes/log4j.properties i have set the following
When i browse in the browser i tried ctrl + ctrl + shift + shift
I do not see any logging of my own.
I have set my script to execute on newly created items in the share. The following is my script.
The problem I am having with this script is; it is not moving the file once I save it but after I have browsed out of the folder, and as mentioned i cannot seem to find where it is logging and I have the logging in my terminal window open and running using
log4j.logger.org.alfresco.repo.jscript=debuglog4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug
When i browse in the browser i tried ctrl + ctrl + shift + shift
I do not see any logging of my own.
I have set my script to execute on newly created items in the share. The following is my script.
logger.log("whatever");var thirdParties = document.properties["sp:thirdParties"];var location = document.properties["sp:location"];var responsibleEmp = document.properties["sp:responsibleEmp"];var contractRef = document.properties["sp:contractRef"];var effectiveDate = document.properties["sp:effectiveDate"];var mctype = document.properties["sp:mctype"];var sourceFile = document;//var sourceFolder = document.parent;var targetFolder = "";var success = true;//Check to see if values are nullif( thirdParties == null || location == "" || responsibleEmp == null || contractRef == null || effectiveDate == null || location.toString() != "UK" || mctype == null ){ success = false; }else{ var effectiveDate = new Date ( document.properties["sp:effectiveDate"] ); //Check if folder exist if(checkFolderExists(location, effectiveDate )){ targetFolder = space.parent.childByNamePath(location.toString()).childByNamePath("Contracts").childByNamePath(effectiveDate.getFullYear().toString()).childByNamePath("MLA and Supplement"); }else{ success = false; // do not move doc no folder exists }}if(success){ var targetFile = targetFolder.childByNamePath(document.name); if(targetFile == null){ sourceFile.move(targetFolder); }else{ var targetFileWorkingCopy = targetFile.checkout(); targetFileWorkingCopy.content = sourceFile.content; targetFileWorkingCopy.checkin("",false); sourceFile.remove(); }}/** Function checks if year folder exists if not then it creeates it * @param String location of created doc * @param Date effectiveDate entered in metadata */function checkFolderExists(location, effectiveDate){ if( !space.parent.childByNamePath(location.toString()).childByNamePath("Contracts").childByNamePath(effectiveDate.getFullYear().toString()) ){ space.parent.childByNamePath(location.toString()).childByNamePath("Contracts").createFolder( effectiveDate.getFullYear().toString() ); //create year folder if( !space.parent.childByNamePath(location.toString()).childByNamePath("Contracts").childByNamePath(effectiveDate.getFullYear().toString()).childByNamePath("MLA and Supplement") ){ space.parent.childByNamePath(location.toString()).childByNamePath("Contracts").childByNamePath(effectiveDate.getFullYear().toString()).createFolder("MLA and Supplement"); // create supllement mla folde rin year folder } return true; }else if( !space.parent.childByNamePath(location.toString()).childByNamePath("Contracts").childByNamePath(effectiveDate.getFullYear().toString()).childByNamePath("MLA and Supplement") ) { space.parent.childByNamePath(location.toString()).childByNamePath("Contracts").childByNamePath(effectiveDate.getFullYear().toString()).createFolder("MLA and Supplement"); // create supllement mla folde rin year folder }else if ( space.parent.childByNamePath(location.toString()).childByNamePath("Contracts").childByNamePath(effectiveDate.getFullYear().toString()).childByNamePath("MLA and Supplement") ) { return true; }else{ return false; }}
The problem I am having with this script is; it is not moving the file once I save it but after I have browsed out of the folder, and as mentioned i cannot seem to find where it is logging and I have the logging in my terminal window open and running using
tail -f /opt/alfresco-4.0.d/tomcat/logs/catalina.out /opt/alfresco-4.0.d/alfresco.log
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2012 08:15 AM
Hello,
for your script you need to configure the /webapps/alfresco/WEB-INF/classes/log4j.properties not the Share one, as your script runs on the Repository, not the Share tier.
Regards
Axel
for your script you need to configure the /webapps/alfresco/WEB-INF/classes/log4j.properties not the Share one, as your script runs on the Repository, not the Share tier.
Regards
Axel

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2012 09:34 AM
I have updated and restarted. I still cannot locate where it is being logged
logger.log("whatever") from my script does not appear anywhere
found it thanks
logger.log("whatever") from my script does not appear anywhere
found it thanks

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2015 09:59 AM
Where you find it ? I'm with the same problem.
