diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java index 170269e3..a3df527f 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/LaunchServer.java @@ -344,7 +344,7 @@ public void run() { try { close(); } catch (Exception e) { - logger.error(e); + logger.error("LaunchServer close error", e); } })); CommonHelper.newThread("Command Thread", true, commandHandler).start(); @@ -361,8 +361,7 @@ public void run() { syncProfilesDir(); modulesManager.invokeEvent(new LaunchServerProfilesSyncEvent(this)); } catch (IOException e) { - logger.error(e); - logger.error("Updates/Profiles not synced"); + logger.error("Updates/Profiles not synced", e); } }).start(); } @@ -373,7 +372,7 @@ public void run() { modulesManager.invokeEvent(new LaunchServerFullInitEvent(this)); logger.info("LaunchServer started"); } catch (Throwable e) { - logger.error(e); + logger.error("LaunchServer startup failed",e); JVMHelper.RUNTIME.exit(-1); } } @@ -419,7 +418,7 @@ public void restart() { try { builder.start(); } catch (IOException e) { - logger.error(e); + logger.error("Restart failed", e); } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java index 1adfce80..eba8c911 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/core/MySQLCoreProvider.java @@ -346,7 +346,7 @@ public void addPublicKeyToHardwareInfo(UserHardware hardware, byte[] publicKey) s.setLong(2, mySQLUserHardware.id); s.executeUpdate(); } catch (SQLException e) { - logger.error(e); + logger.error("SQL error", e); } } @@ -363,7 +363,7 @@ public Iterable getUsersByHardwareInfo(UserHardware hardware) { } } } catch (SQLException e) { - logger.error(e); + logger.error("SQL error", e); return null; } return users; @@ -379,7 +379,7 @@ public void banHardware(UserHardware hardware) { s.setLong(2, mySQLUserHardware.id); s.executeUpdate(); } catch (SQLException e) { - logger.error(e); + logger.error("SQL Error", e); } } @@ -393,7 +393,7 @@ public void unbanHardware(UserHardware hardware) { s.setLong(2, mySQLUserHardware.id); s.executeUpdate(); } catch (SQLException e) { - logger.error(e); + logger.error("SQL error", e); } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/CertificateAutogenTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/CertificateAutogenTask.java index 82c998e9..4ab793af 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/CertificateAutogenTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/CertificateAutogenTask.java @@ -77,7 +77,7 @@ public Path process(Path inputFile) throws IOException { chain.add(certificate); signedDataGenerator = SignHelper.createSignedDataGenerator(server.keyAgreementManager.ecdsaPrivateKey, certificate, chain, "SHA256WITHECDSA"); } catch (OperatorCreationException | CMSException | CertificateException e) { - logger.error(e); + logger.error("Certificate generate failed", e); } return inputFile; } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java index 6f265068..fc2bef9d 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/MainBuildTask.java @@ -89,7 +89,7 @@ protected void postInitProps() { try { return e.getEncoded(); } catch (CertificateEncodingException e2) { - logger.error(e2); + logger.error("Certificate encoding failed", e2); return new byte[0]; } }).collect(Collectors.toList()); diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/SignJarTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/SignJarTask.java index 812035f5..a880c863 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/SignJarTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/SignJarTask.java @@ -41,7 +41,7 @@ public static CMSSignedDataGenerator gen(LaunchServerConfig.JarSignerConf config config.keyAlias, config.signAlgo, config.keyPass); } catch (CertificateEncodingException | UnrecoverableKeyException | KeyStoreException | OperatorCreationException | NoSuchAlgorithmException | CMSException e) { - logger.error(e); + logger.error("Create signedDataGenerator failed", e); return null; } } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/NettyThreadFactory.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/NettyThreadFactory.java index d9394422..753bbfc8 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/NettyThreadFactory.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/NettyThreadFactory.java @@ -18,7 +18,7 @@ protected Thread newThread(Runnable r, String name) { if (e.getMessage().contains("Connection reset by peer")) { return; } - logger.error(e); + logger.error("Netty exception", e); }); return thread; } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/WebSocketFrameHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/WebSocketFrameHandler.java index 05283b71..8af37ca0 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/WebSocketFrameHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/handlers/WebSocketFrameHandler.java @@ -63,7 +63,7 @@ protected void channelRead0(ChannelHandlerContext ctx, WebSocketFrame frame) { try { if (hooks.hook(ctx, frame)) return; } catch (Throwable ex) { - logger.error(ex); + logger.error("WebSocket frame handler hook error", ex); } if (frame instanceof TextWebSocketFrame) { try { @@ -72,7 +72,7 @@ protected void channelRead0(ChannelHandlerContext ctx, WebSocketFrame frame) { logger.warn("Client {} send invalid request. Connection force closed.", context.ip == null ? IOHelper.getIP(ctx.channel().remoteAddress()) : context.ip); if (logger.isTraceEnabled()) { logger.trace("Client message: {}", ((TextWebSocketFrame) frame).text()); - logger.error(ex); + logger.error("Process websockets request failed", ex); } ctx.channel().close(); } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/JoinServerResponse.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/JoinServerResponse.java index 2c861ad7..30125952 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/JoinServerResponse.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/response/auth/JoinServerResponse.java @@ -49,7 +49,7 @@ public void execute(ChannelHandlerContext ctx, Client client) { sendError(e.getMessage()); return; } catch (Exception e) { - logger.error(e); + logger.error("Join Server error", e); sendError("Internal authHandler error"); return; }