会员登录
|
免费注册
|
忘记密码
|
管理入口
返回主站
|
|
保存桌面
文章
动态
资讯
K linux 部署手机 centos6.5linux手机「K linux 部署手机 centos6.5」
2025-02-16
IP属地 湖北
4
package com.weds.f
ramework.utils.elk; i
mport java.util.Map; i
mport java.util.concurrent.CompletableFuture; i
mport org.apache.log4j.AppenderSkeleton; i
mport org.apache.log4j.spi.LocationInfo; i
mport org.apache.log4j.spi.LoggingEvent; i
mport com.weds.f
ramework.core.utils.JsonUtil; i
mport com.weds.f
ramework.core.utils.redis.RedisService; public class ApiAppender extends AppenderSkeleton{ private RedisService redisService; private String writeLogKey; @Override public void close() { // TODO Auto-generated method stub } @Override public boolean requiresLayout() { // TODO Auto-generated method stub return false; } @Override protected void append(LoggingEvent event) { Locatio
nInfo locatio
nInfo = event.getLocatio
nInformation(); Map<String,Object> map =(Map<String,Object>)event.getMessage(); map.put("levl", event.getLevel().toString()); writeLogAsync(writeLogKey,map); } public void writeLogAsync(String key,Map<String,Object> map){ CompletableFuture.runAsync(() -> { writeLog(key,map); }); } public void writeLogAsync(String key,String value){ CompletableFuture.runAsync(() -> { writeLog(key,value); }); } public void writeLog(String key,Map<String,Object> map){ String value = JsonUtil.obj2string(map); writeLog(key, value); } public void writeLog(String key, String value) { if(key != null){ redisService =(RedisService)SpringContextUtil.getBean("redisService",RedisService.class); redisService.setList(key, value); } } public RedisService getRedisService() { return redisService; } public void setRedisService(RedisService redisService) { this.redisService = redisService; } public String getWriteLogKey() { return writeLogKey; } public void setWriteLogKey(String writeLogKey) { this.writeLogKey = writeLogKey; } }
相关文章
小松平地机HD785-7轴承561-22-72520
71阅读
相关动态
最新文章
苹果 iPhone 更换官方电池需要多少费用【详解】苹果手机换电池多少钱「苹果 iPhone 更换官方电池需要多少费用【详解】」
9阅读
李云泽:将研究提高消费贷款额度,延长消费贷款期限
13阅读
K linux 部署手机 centos6.5linux手机「K linux 部署手机 centos6.5」
4阅读
防水的手机有哪些手机防水「防水的手机有哪些」
21阅读
手机主板图片(手机主板图片大全)
25阅读