|
@@ -19,9 +19,7 @@ public class AliyunLogger {
|
|
|
private final String app = "daka";
|
|
|
|
|
|
|
|
|
- public void init() {
|
|
|
-
|
|
|
-
|
|
|
+ public AliyunLogger() {
|
|
|
ProducerConfig producerConfig = new ProducerConfig();
|
|
|
producerConfig.setBatchSizeThresholdInBytes(3 * 1024 * 1024);
|
|
|
producerConfig.setBatchCountThreshold(40960);
|
|
@@ -34,6 +32,7 @@ public class AliyunLogger {
|
|
|
Runtime.getRuntime().addShutdownHook(new Thread(this::close));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public void debug(Object... kv) {
|
|
|
try {
|
|
|
LogItem item = log(kv);
|
|
@@ -118,7 +117,6 @@ public class AliyunLogger {
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
AliyunLogger aliyunLogger = new AliyunLogger();
|
|
|
- aliyunLogger.init();
|
|
|
|
|
|
aliyunLogger.info("msg", "123");
|
|
|
aliyunLogger.info("msg", 1);
|