RTC: Is it possible to write logs into jazz.log file located in RTC Server machine
Hi Ralph,
Can you please help me on this requirement?
I just want to programmatically write logger statements from my plugin to jazz.log file located in RTC Server location.
I use JAZZ Admin User ID[which has admin access as well as root access for permissions] to login to RTC Server and trying to write logger statements into Jazz.log file. Getting the below exception,
Exception=java.io.FileNotFoundException
: \opt\IBM\Demo_JazzTeamServer_4.0.6\server\logs\ccm.log (The system cannot find the path specified.)
Kindly help on this!
Thanks
Sudar
Accepted answer
.getLog()
and then log data. This assumes that your extension is based on the class AbstractService as it should be.
Comments
Thanks Ralph !
Ralph,
Actually, i would require to log from my Client-side plugin into jazz.log. Kindly advice on this.
Is there a way to write logger from Client-side plugin into jazz.log file?
You can't, unless you write something that talks to something in the server that has the log file open using the aforementioned method getLog(). For local logging, this is what I found:
public void log(String message, Throwable exception) {
FoundationLog.getLog(PLUGIN_ID).error(message, exception);
}
PS if you try to open that file and write from a second source, you will either fail or mess up the logs.
you could always create a logger service that your client uses. requires you to install you service plugin on the server..
Thanks Ralph and Sam !!
Comments
Sudaraazhi Arivalagan
Apr 03 '19, 12:05 a.m.Actually, i could write the logs into jazz.log file using the below steps, but problem is, i couldn't append the lines into file, instead of overriding the file now.
1) Programmatically, I login to server by rtcadmin login[added in admin group ids, has required permissions to write and read the file]
2) Using ChannelSftp and OutputStream, i write logs into jazz.log file.
But, only thing, i need to append the lines instead of overriding the file content. I tried FileOutputStreams and method of writing a file. Didn't work.
Kindly help me if you have any other idea.
Thanks,
Sudar