It's all about the answers!

Ask a question

RTC: Is it possible to write logs into jazz.log file located in RTC Server machine


Sudaraazhi Arivalagan (441728) | asked Apr 02 '15, 5:20 a.m.

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


Comments
Sudaraazhi Arivalagan commented Apr 03 '15, 9:14 a.m. | edited 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

Accepted answer


permanent link
Ralph Schoon (63.1k33646) | answered Apr 02 '15, 5:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Apr 02 '15, 5:46 a.m.
From within a server extension you can get the log using

.getLog()

and then log data. This assumes that your extension is based on the class AbstractService as it should be.
Sudaraazhi Arivalagan selected this answer as the correct answer

Comments
Sudaraazhi Arivalagan commented Apr 02 '15, 5:46 a.m.

Thanks Ralph !


Sudaraazhi Arivalagan commented Apr 02 '15, 6:03 a.m.

Ralph,

Actually, i would require to log from my Client-side plugin into jazz.log. Kindly advice on this.


Sudaraazhi Arivalagan commented Apr 02 '15, 6:35 a.m. | edited Apr 02 '15, 7:12 p.m.

Is there a way to write logger from Client-side plugin into jazz.log file?


Ralph Schoon commented Apr 02 '15, 6:50 a.m. | edited Apr 02 '15, 6:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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);
    }


Ralph Schoon commented Apr 02 '15, 6:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

PS if you try to open that file and write from a second source, you will either fail or mess up the logs.


sam detweiler commented Apr 02 '15, 7:40 p.m.

you could always create a logger service that your client uses.  requires you to install you service plugin on the server..


Sudaraazhi Arivalagan commented Apr 03 '15, 8:48 a.m.

Thanks Ralph and Sam !!

showing 5 of 7 show 2 more comments

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.