Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
4450b0eb
S
SkyWalking
项目概览
山不在高_有仙则灵
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
12
Star
0
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4450b0eb
编写于
12月 07, 2016
作者:
A
ascrutae
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复部分问题
上级
c0f6d20a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
22 addition
and
30 deletion
+22
-30
skywalking-application-toolkit/skywalking-toolkit-log4j-1.x/pom.xml
...-application-toolkit/skywalking-toolkit-log4j-1.x/pom.xml
+1
-1
skywalking-sniffer/skywalking-agent/src/main/java/com/a/eye/skywalking/agent/SkyWalkingAgent.java
...main/java/com/a/eye/skywalking/agent/SkyWalkingAgent.java
+0
-2
skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/client/Agent2RoutingClient.java
...java/com/a/eye/skywalking/client/Agent2RoutingClient.java
+2
-2
skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/logging/EasyLogger.java
...rc/main/java/com/a/eye/skywalking/logging/EasyLogger.java
+11
-16
skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/logging/LogLevel.java
.../src/main/java/com/a/eye/skywalking/logging/LogLevel.java
+8
-0
skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-1.x-activation/pom.xml
...ctivation/skywalking-toolkit-log4j-1.x-activation/pom.xml
+0
-9
未找到文件。
skywalking-application-toolkit/skywalking-toolkit-log4j-1.x/pom.xml
浏览文件 @
4450b0eb
...
...
@@ -16,7 +16,7 @@
<groupId>
log4j
</groupId>
<artifactId>
log4j
</artifactId>
<version>
1.2.17
</version>
<scope>
compile
</scope>
<scope>
provided
</scope>
</dependency>
</dependencies>
...
...
skywalking-sniffer/skywalking-agent/src/main/java/com/a/eye/skywalking/agent/SkyWalkingAgent.java
浏览文件 @
4450b0eb
package
com.a.eye.skywalking.agent
;
import
com.a.eye.skywalking.agent.junction.SkyWalkingEnhanceMatcher
;
import
com.a.eye.skywalking.client.Agent2RoutingClient
;
import
com.a.eye.skywalking.conf.Config
;
import
com.a.eye.skywalking.conf.ConfigInitializer
;
import
com.a.eye.skywalking.logging.EasyLogResolver
;
...
...
@@ -37,7 +36,6 @@ public class SkyWalkingAgent {
initConfig
();
Agent2RoutingClient
.
INSTANCE
.
onReady
();
final
PluginDefineCategory
pluginDefineCategory
=
PluginDefineCategory
.
category
(
new
PluginBootstrap
().
loadPlugins
());
new
AgentBuilder
.
Default
().
type
(
enhanceClassMatcher
(
pluginDefineCategory
).
and
(
not
(
isInterface
()))).
transform
(
new
AgentBuilder
.
Transformer
()
{
...
...
skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/client/Agent2RoutingClient.java
浏览文件 @
4450b0eb
...
...
@@ -10,14 +10,12 @@ import com.a.eye.skywalking.logging.api.LogManager;
import
com.a.eye.skywalking.network.Client
;
import
com.a.eye.skywalking.network.grpc.AckSpan
;
import
com.a.eye.skywalking.network.grpc.RequestSpan
;
import
com.a.eye.skywalking.network.grpc.SendResult
;
import
com.a.eye.skywalking.network.grpc.client.SpanStorageClient
;
import
com.a.eye.skywalking.network.listener.client.StorageClientListener
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Random
;
import
java.util.concurrent.locks.LockSupport
;
/**
* Created by wusheng on 2016/11/27.
...
...
@@ -46,6 +44,8 @@ public class Agent2RoutingClient extends Thread {
addrList
.
add
(
new
ServerAddr
(
addrSegments
[
0
],
addrSegments
[
1
]));
}
listener
=
new
NetworkListener
();
onReady
();
}
public
void
onReady
()
{
...
...
skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/logging/EasyLogger.java
浏览文件 @
4450b0eb
...
...
@@ -7,6 +7,8 @@ import java.net.URLEncoder;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
static
com
.
a
.
eye
.
skywalking
.
logging
.
LogLevel
.*;
/**
* Created by xin on 16-6-23.
*/
...
...
@@ -18,14 +20,14 @@ public class EasyLogger implements com.a.eye.skywalking.logging.api.ILog {
this
.
toBeLoggerClass
=
toBeLoggerClass
;
}
public
void
logger
(
String
level
,
String
message
,
Throwable
e
)
{
public
void
logger
(
LogLevel
level
,
String
message
,
Throwable
e
)
{
Throwable
dummyException
=
new
Throwable
();
StackTraceElement
locations
[]
=
dummyException
.
getStackTrace
();
if
(
locations
!=
null
&&
locations
.
length
>
2
)
{
if
(
ERROR
.
equals
(
level
)
||
WARN
.
equals
(
level
))
{
if
(
ERROR
.
equals
(
level
)
||
WARN
.
equals
(
level
))
{
WriterFactory
.
getLogWriter
().
writeError
(
formatMessage
(
level
,
message
,
locations
[
2
]));
}
else
{
}
else
{
WriterFactory
.
getLogWriter
().
write
(
formatMessage
(
level
,
message
,
locations
[
2
]));
}
}
...
...
@@ -53,18 +55,11 @@ public class EasyLogger implements com.a.eye.skywalking.logging.api.ILog {
}
private
String
formatMessage
(
String
level
,
String
message
,
StackTraceElement
caller
)
{
private
String
formatMessage
(
LogLevel
level
,
String
message
,
StackTraceElement
caller
)
{
return
level
+
" "
+
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
())
+
" "
+
caller
.
getClassName
()
+
"."
+
caller
.
getMethodName
()
+
"("
+
caller
.
getFileName
()
+
":"
+
caller
.
getLineNumber
()
+
") "
+
message
;
}
private
static
final
String
ERROR
=
"ERROR"
;
private
static
final
String
WARN
=
"WARN"
;
private
static
final
String
DEBUG
=
"DEBUG"
;
private
static
final
String
INFO
=
"INFO"
;
@Override
public
void
info
(
String
format
)
{
logger
(
INFO
,
format
,
null
);
...
...
@@ -72,17 +67,17 @@ public class EasyLogger implements com.a.eye.skywalking.logging.api.ILog {
@Override
public
void
info
(
String
format
,
Object
...
arguments
)
{
logger
(
INFO
,
replaceParam
(
INFO
,
format
,
arguments
),
null
);
logger
(
INFO
,
replaceParam
(
format
,
arguments
),
null
);
}
@Override
public
void
warn
(
String
format
,
Object
...
arguments
)
{
logger
(
WARN
,
replaceParam
(
WARN
,
format
,
arguments
),
null
);
logger
(
WARN
,
replaceParam
(
format
,
arguments
),
null
);
}
@Override
public
void
warn
(
String
format
,
Object
arguments
,
Throwable
e
)
{
logger
(
WARN
,
replaceParam
(
WARN
,
format
,
arguments
),
e
);
logger
(
WARN
,
replaceParam
(
format
,
arguments
),
e
);
}
@Override
...
...
@@ -92,7 +87,7 @@ public class EasyLogger implements com.a.eye.skywalking.logging.api.ILog {
@Override
public
void
error
(
String
format
,
Object
arguments
,
Throwable
e
)
{
logger
(
ERROR
,
replaceParam
(
ERROR
,
format
,
arguments
),
e
);
logger
(
ERROR
,
replaceParam
(
format
,
arguments
),
e
);
}
@Override
...
...
@@ -122,6 +117,6 @@ public class EasyLogger implements com.a.eye.skywalking.logging.api.ILog {
@Override
public
void
debug
(
String
format
,
Object
...
arguments
)
{
logger
(
DEBUG
,
replaceParam
(
DEBUG
,
format
,
arguments
),
null
);
logger
(
DEBUG
,
replaceParam
(
format
,
arguments
),
null
);
}
}
skywalking-sniffer/skywalking-api/src/main/java/com/a/eye/skywalking/logging/LogLevel.java
0 → 100644
浏览文件 @
4450b0eb
package
com.a.eye.skywalking.logging
;
/**
* Created by xin on 2016/12/7.
*/
public
enum
LogLevel
{
INFO
,
DEBUG
,
WARN
,
ERROR
}
skywalking-sniffer/skywalking-toolkit-activation/skywalking-toolkit-log4j-1.x-activation/pom.xml
浏览文件 @
4450b0eb
...
...
@@ -10,13 +10,4 @@
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
skywalking-toolkit-log4j-1.x-activation
</artifactId>
<dependencies>
<dependency>
<groupId>
com.a.eye
</groupId>
<artifactId>
skywalking-toolkit-log4j-1.x
</artifactId>
<version>
${project.version}
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</project>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录