on 07-08-2015 7:17 PM
Hi all,
I'm writing some code(redwoodScript/Java) in our sapcps V8 Environment.
I'm creating code to be used on a library or/and a trigger.
for debugging purposes I would like to create a file on the application server FS and log the debug information there.
using this
fdebug = new PrintWriter(new BufferedWriter(new FileWriter("/var/tmp/sapcpsdebug/trigger.log", true)));
I can get a logfile created. however every time the trigger executes it deletes the file and starts again.
I would like to know what is the better way to do this kind of thing.
Requirements is to have a separated file for this.
I think we should be able to use the logging classes to add a new log the the application server in order to perform a better usage of resources, but I'm a bit lost here.
any idea on how to do this, or were to look for more information?.
Regards.
Get the current datetime from the system and append it to the file name.
This way you will have a different file everytime.
thanks
Nanda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nada,
That's a nice solution, but it does not what I really wanted/need
I would like to have only one file and all the iterations of the tiggers writing to it.
I guess there have to be two solutions:
1 open always the same file for appending (it's costly and it's not working) that was my first approach.
2 I guess it has to be posible to create a new log like in the netweaver server and use it from the trigger not having to worry about open and close the log file. and having much better "performance" however I don't know how to create a new logger.
Regards.
Miguel Campos.
Hello,
In a Library you can create your own Logger using:
package com.redwood.scheduler.custom.mycompany;
import com.redwood.scheduler.api.scripting.variables.LibraryLoggerFactory;
import com.redwood.scheduler.infrastructure.logging.api.Logger;
class YourClass
{
Logger log = LibraryLoggerFactory.getLogger(YourClass.class);
log.debug("Hello World");
}
Using the Job Definition System_DynamicTrace you can fetch the debug information by specifying custom.mycompony=debug as the trace string.
Regards Gerben
Hi Gerben,
Thanks for your answer, that's the idea however doing it like that my question is to which file. fisically on the appserver will it write.
I have physical access to the unix FS so I would like to do a tail -f XXXX and see my debug messages but only my debug messages and I think that if we use this method the info will go to the mail log in the appserver.
Regards.
Miguel Campos.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.