String user = "No User Involved"; String cert = "No Certificate Involved"; String admin = "Administrator not known";  if (username != null) user = username;  if (certificate != null) cert = certificate.getSerialNumber().toString(16) + ", issuer: " + certificate.getIssuerDN().toString();  if (admininfo.getAdminType() == Admin.TYPE_CLIENTCERT_USER) admin = Admin.ADMINTYPETEXTS[Admin.TYPE_CLIENTCERT_USER] + ", Certificate SNR : " + admininfo.getAdminData(); else if (admininfo.getAdminType() == Admin.TYPE_PUBLIC_WEB_USER) { if (admininfo.getAdminData() != null) { if (!admininfo.getAdminData().equals("")) admin = Admin.ADMINTYPETEXTS[Admin.TYPE_PUBLIC_WEB_USER] + ", IP Address : " + admininfo.getAdminData(); } else admin = Admin.ADMINTYPETEXTS[Admin.TYPE_PUBLIC_WEB_USER]; } else admin = Admin.ADMINTYPETEXTS[admininfo.getAdminType()];  if (event < LogEntry.EVENT_ERROR_BOUNDRARY) {  log.info(DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(time) + ", CAId : " + caid + ", " + LogEntry.MODULETEXTS[module] + ", " + LogEntry.EVENTNAMES_INFO[event] + ", Administrator : " + admin + ", User : " + user + ", Certificate : " + cert + ", Comment : " + comment); } else {  log.error(DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(time) + ", CAId : " + caid + ", " + LogEntry.MODULETEXTS[module] + ", " + LogEntry.EVENTNAMES_ERROR[event - LogEntry.EVENT_ERROR_BOUNDRARY] + ", Administrator : " + admin + ", User : " + user + ", Certificate : " + cert + ", Comment : " + comment); }
log(admininfo, caid, module, time, username, certificate, event, comment, null);
    public void log(Admin admininfo, int caid, int module, Date time, String username, X509Certificate certificate, int event, String comment) {        String user = "No User Involved";        String cert = "No Certificate Involved";        String admin = "Administrator not known";        if (username != null)            user = username;        if (certificate != null)            cert = certificate.getSerialNumber().toString(16) + ", issuer: " + certificate.getIssuerDN().toString();        if (admininfo.getAdminType() == Admin.TYPE_CLIENTCERT_USER)            admin = Admin.ADMINTYPETEXTS[Admin.TYPE_CLIENTCERT_USER] + ", Certificate SNR : " + admininfo.getAdminData();        else if (admininfo.getAdminType() == Admin.TYPE_PUBLIC_WEB_USER) {            if (admininfo.getAdminData() != null) {                if (!admininfo.getAdminData().equals(""))                    admin = Admin.ADMINTYPETEXTS[Admin.TYPE_PUBLIC_WEB_USER] + ", IP Address : " + admininfo.getAdminData();            } else                admin = Admin.ADMINTYPETEXTS[Admin.TYPE_PUBLIC_WEB_USER];        } else            admin = Admin.ADMINTYPETEXTS[admininfo.getAdminType()];        if (event < LogEntry.EVENT_ERROR_BOUNDRARY) {            // Do Log4j Informational logging.            log.info(DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(time) + ", CAId : " + caid + ", " + LogEntry.MODULETEXTS[module] + ", " + LogEntry.EVENTNAMES_INFO[event] + ", Administrator : " +                    admin + ", User : " + user + ", Certificate : " + cert + ", Comment : " + comment);        } else {            // Do Log4j error logging.            log.error(DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(time) + ", CAId : " + caid + ", " + LogEntry.MODULETEXTS[module] + ", " + LogEntry.EVENTNAMES_ERROR[event - LogEntry.EVENT_ERROR_BOUNDRARY] + ", Administrator : " +                    admin + ", User : " + user + ", Certificate : " + cert + ", Comment : " + comment);        }    }