You can write to the .log file in the workspace .metadata directory using:
Bundle bundle = Platform.getBundle("plugin id");
IStatus status = new Status(IStatus.ERROR, "plugin id", msg or null, throwable or null);
Platform.getLog(bundle).log(status);
The first parameter to Status
can be IStatus.INFO
, WARNING
or ERROR
.