cziegeler 01/07/13 07:07:54
Modified: src/org/apache/cocoon Tag: cocoon_20_branch Main.java
Log:
Fix for command line generator. The log dir and log file of the context were not set
Revision Changes Path
No revision
No revision
1.4.2.5 +14 -4 xml-cocoon2/src/org/apache/cocoon/Main.java
Index: Main.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/Main.java,v
retrieving revision 1.4.2.4
retrieving revision 1.4.2.5
diff -u -r1.4.2.4 -r1.4.2.5
--- Main.java 2001/07/04 07:26:19 1.4.2.4
+++ Main.java 2001/07/13 14:07:45 1.4.2.5
@@ -48,7 +48,7 @@
* Command line entry point.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.4.2.4 $ $Date: 2001/07/04 07:26:19 $
+ * @version CVS $Revision: 1.4.2.5 $ $Date: 2001/07/13 14:07:45 $
*/
public class Main {
@@ -125,6 +125,7 @@
boolean xspOnly = false;
String userAgent = DEFAULT_USER_AGENT;
String accept = DEFAULT_ACCEPT;
+ String logDir = "", logFile = "";
List clOptions = parser.getArguments();
int size = clOptions.size();
@@ -184,11 +185,18 @@
log = Hierarchy.getDefaultHierarchy().getLoggerFor("cocoon");
log.setPriority(priority);
-
- if(logUrl == null)
+ // FIXME
+ // The log dir and log file must be detected correct
+ // This is only a simple hack to make the sitemap manager happy
+ if(logUrl == null) {
log.setLogTargets( new LogTarget[] {new
DefaultOutputLogTarget(System.out)});
- else
+ logDir = "";
+ logFile = "";
+ } else {
log.setLogTargets(new LogTarget[] {new
FileOutputLogTarget(logUrl)});
+ logFile = logUrl;
+ logDir = "";
+ }
} catch (MalformedURLException mue) {
String error = "Cannot write on the specified log file. Please, make
sure the path exists and you have write permissions.";
Hierarchy.getDefaultHierarchy().log(error, mue);
@@ -240,6 +248,8 @@
appContext.put(Constants.CONTEXT_WORK_DIR, work);
appContext.put(Constants.CONTEXT_UPLOAD_DIR, contextDir + "image-dir");
appContext.put(Constants.CONTEXT_CONFIG_URL, conf.toURL());
+ appContext.put(Constants.CONTEXT_LOG_DIR, logDir);
+ appContext.put(Constants.CONTEXT_LOG_FILE, logFile);
Cocoon c = new Cocoon();
c.setLogger(log);
c.contextualize(appContext);
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]