Reputation: 6846
I have no prior experience with Java and I'm trying to debug a Java class. The class gets called from C++ code. The Java code is full of SysLog
calls that would be very helpful to me, but I can't figure out where the output goes, if anywhere.
SysLog
is initialized quite simply like this:
public static void initLogger() {
if (log == null) {
log = new Syslog();
}
}
And just to complicate matters, this code is running as a Windows service which means it cannot display any sort of UI, not even console output. The logging must go to a file to be useful.
Do I need to do something to enable the logging? If so, what?
Do I need to do something to send the logging to file(s)? If so, what?
Upvotes: 0
Views: 910
Reputation: 1249
Some info about Syslog - it was originally developed as a generic UNIX logging service. It can log local messages from the system or collect log messages from a number of different servers on the network. Generally any UNIX system will have some implementation of a syslog service available on it. It is a common way of aggregating messages from a number of systems.
On windows, there are a number of syslog server implementations out there. If a syslog service is running on your windows box, then the message might be ending up there.
However, the real question is: to which syslog services does your java app send messages? In theory you could configure your java app to send syslog messages to a remote machine. Or it could try to send messages to the local host (since the syslog listens on a default port).
So I think what VD is saying is to check your java application settings and look for syslog configuration settings. You will have to gain access to a syslog server (either install one locally on windows or get a remote machine to listen). And then using this link configure your java app appropriately.
An additional complication might be that your java environment uses a custom or special sysloghandler. The log4j is very common and is probably the default, but you might want to check that as well.
Upvotes: 1