Skip to content

Commit f9e1b1e

Browse files
committed
fix bug about log info is too large
1 parent c8a0ce2 commit f9e1b1e

File tree

17 files changed

+43
-31
lines changed

17 files changed

+43
-31
lines changed

skyeye-alarm/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ apply plugin: 'application'
66

77
group = 'skyeye'
88
applicationName = 'skyeye-alarm'
9-
version = '1.1.0'
9+
version = '1.1.1'
1010

1111
sourceCompatibility = 1.8
1212
targetCompatibility = 1.8
@@ -21,8 +21,8 @@ repositories {
2121
}
2222

2323
ext {
24-
baseVersion = '1.1.0'
25-
dataVersion = '1.1.0'
24+
baseVersion = '1.1.1'
25+
dataVersion = '1.1.1'
2626
}
2727

2828
dependencies {

skyeye-base/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'maven'
33
apply plugin: 'eclipse'
44

55
group = 'skyeye'
6-
version = '1.1.0'
6+
version = '1.1.1'
77

88
sourceCompatibility = 1.8
99
targetCompatibility = 1.8

skyeye-benchmark/dubbo-service/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ allprojects {
33
apply plugin: 'eclipse'
44

55
group = 'skyeye'
6-
version = '1.1.0'
6+
version = '1.1.1'
77
sourceCompatibility = 1.8
88
targetCompatibility = 1.8
99
compileJava.options.encoding = 'UTF-8'
@@ -37,8 +37,8 @@ subprojects {
3737
ext {
3838
slf4jVersion = '1.7.21'
3939
dubboVersion = '2.8.4-skyeye-trace-1.1.0'
40-
dataVersion = '1.1.0'
41-
clientVersion = '1.1.0'
40+
dataVersion = '1.1.1'
41+
clientVersion = '1.1.1'
4242
zookeeperVerison = '3.4.6'
4343
zkClientVersion = '0.10'
4444
}

skyeye-benchmark/hi-log/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ allprojects {
33
apply plugin: 'eclipse'
44

55
group = 'skyeye'
6-
version = '1.1.0'
6+
version = '1.1.1'
77
sourceCompatibility = 1.8
88
targetCompatibility = 1.8
99
compileJava.options.encoding = 'UTF-8'
@@ -35,7 +35,7 @@ subprojects {
3535
apply plugin: 'eclipse'
3636

3737
ext {
38-
clientVersion = '1.1.0'
38+
clientVersion = '1.1.1'
3939
}
4040

4141
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

skyeye-benchmark/log-generater/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ apply plugin: 'application'
66

77
group = 'skyeye'
88
applicationName = 'log-generater'
9-
version = '1.1.0'
9+
version = '1.1.1'
1010

1111
sourceCompatibility = 1.8
1212
targetCompatibility = 1.8
@@ -21,7 +21,7 @@ repositories {
2121
}
2222

2323
ext {
24-
clientVersion = '1.1.0'
24+
clientVersion = '1.1.1'
2525
}
2626

2727
dependencies {

skyeye-client/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ allprojects {
44
apply plugin: 'eclipse'
55

66
group = 'skyeye'
7-
version = '1.1.0'
7+
version = '1.1.1'
88

99
sourceCompatibility = 1.8
1010
targetCompatibility = 1.8
@@ -57,8 +57,8 @@ subprojects {
5757
kafkaVersion = '0.10.0.1'
5858
zookeeperVersion = '3.4.6'
5959
zkclientVersion = '0.10'
60-
baseVersion = '1.1.0'
61-
traceVersion = '1.1.0'
60+
baseVersion = '1.1.1'
61+
traceVersion = '1.1.1'
6262
}
6363

6464
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

skyeye-client/skyeye-client-log4j/src/main/java/com/jthink/skyeye/client/log4j/appender/KafkaAppender.java

+4
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ protected void append(LoggingEvent event) {
129129
* @param value
130130
*/
131131
private void send(String value) {
132+
// 对value的大小进行判定,当大于某个值认为该日志太大直接丢弃(防止影响到kafka)
133+
if (value.length() > 10000) {
134+
return;
135+
}
132136
final byte[] key = ByteBuffer.allocate(4).putInt(new StringBuilder(app).append(host).toString().hashCode()).array();
133137

134138
final ProducerRecord<byte[], String> record = new ProducerRecord<>(this.topic, key, value);

skyeye-client/skyeye-client-log4j2/src/main/java/com/jthink/skyeye/client/log4j2/appender/KafkaAppender.java

+4
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ public void append(LogEvent event) {
9191
}
9292
// 发送数据到kafka
9393
String value = System.nanoTime() + Constants.SEMICOLON + new String(data);
94+
// 对value的大小进行判定,当大于某个值认为该日志太大直接丢弃(防止影响到kafka)
95+
if (value.length() > 10000) {
96+
return;
97+
}
9498
final ProducerRecord<byte[], String> record = new ProducerRecord<>(this.manager.getTopic(), this.manager.getKey(), value);
9599
LazySingletonProducer.getInstance(this.manager.getConfig()).send(record, new Callback() {
96100
@Override

skyeye-client/skyeye-client-logback/src/main/java/com/jthink/skyeye/client/logback/appender/KafkaAppender.java

+4
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ protected void append(E e) {
125125
return;
126126
}
127127
final String value = System.nanoTime() + Constants.SEMICOLON + this.encoder.doEncode(e);
128+
// 对value的大小进行判定,当大于某个值认为该日志太大直接丢弃(防止影响到kafka)
129+
if (value.length() > 10000) {
130+
return;
131+
}
128132
final byte[] key = this.keyBuilder.build(e);
129133
final ProducerRecord<byte[], String> record = new ProducerRecord<byte[], String>(this.topic, key, value);
130134
LazySingletonProducer.getInstance(this.config).send(record, new Callback() {

skyeye-collector/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ allprojects {
33
apply plugin: 'eclipse'
44

55
group = 'skyeye'
6-
version = '1.1.0'
6+
version = '1.1.1'
77
sourceCompatibility = 1.8
88
targetCompatibility = 1.8
99
compileJava.options.encoding = 'UTF-8'
@@ -37,7 +37,7 @@ subprojects {
3737
apply plugin: 'eclipse'
3838

3939
ext {
40-
baseVersion = '1.1.0'
40+
baseVersion = '1.1.1'
4141
kafkaVersion = '0.10.0.1'
4242
springBootVersion = '1.5.6.RELEASE'
4343
esVersion = '2.3.3'

skyeye-collector/skyeye-collector-metrics/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apply plugin: 'org.springframework.boot'
55
apply plugin: 'application'
66

77
ext {
8-
dataVersion = '1.1.0'
8+
dataVersion = '1.1.1'
99
zkclientVersion = '0.10'
1010
}
1111

skyeye-collector/skyeye-collector-trace/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apply plugin: 'org.springframework.boot'
55
apply plugin: 'application'
66

77
ext {
8-
dataVersion = '1.1.0'
8+
dataVersion = '1.1.1'
99
fastJsonVersion = '1.2.35'
1010
}
1111

skyeye-data/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ allprojects {
44
apply plugin: 'eclipse'
55

66
group = 'skyeye'
7-
version = '1.1.0'
7+
version = '1.1.1'
88

99
sourceCompatibility = 1.8
1010
targetCompatibility = 1.8
@@ -55,7 +55,7 @@ subprojects {
5555

5656
ext {
5757
slf4jVersion = '1.7.25'
58-
baseVersion = '1.1.0'
58+
baseVersion = '1.1.1'
5959
}
6060

6161
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

skyeye-monitor/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ apply plugin: 'application'
66

77
group = 'skyeye'
88
applicationName = 'skyeye-monitor'
9-
version = '1.1.0'
9+
version = '1.1.1'
1010

1111
sourceCompatibility = 1.8
1212
targetCompatibility = 1.8
@@ -23,8 +23,8 @@ repositories {
2323
ext {
2424
zookeeperVersion = '3.4.6'
2525
curatorVersion = '2.11.0'
26-
baseVersion = '1.1.0'
27-
dataVersion = '1.1.0'
26+
baseVersion = '1.1.1'
27+
dataVersion = '1.1.1'
2828
jacksonVersion = '1.9.13'
2929
zkclientVersion = '0.10'
3030
}

skyeye-statistics/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ apply plugin: 'application'
66

77
group = 'skyeye'
88
applicationName = 'skyeye-statistics'
9-
version = '1.1.0'
9+
version = '1.1.1'
1010

1111
sourceCompatibility = 1.8
1212
targetCompatibility = 1.8
@@ -27,7 +27,7 @@ ext {
2727
scalaVersion = '2.10.4'
2828
scalaBinaryVersion = '2.10'
2929
sparkVersion = '1.3.0-cdh5.4.0'
30-
baseVersion = '1.1.0'
30+
baseVersion = '1.1.1'
3131
fastjsonVersion = '1.2.35'
3232
zkClientVersion = '0.10'
3333
}

skyeye-trace/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'maven'
33
apply plugin: 'eclipse'
44

55
group = 'skyeye'
6-
version = '1.1.0'
6+
version = '1.1.1'
77

88
sourceCompatibility = 1.8
99
targetCompatibility = 1.8
@@ -14,8 +14,8 @@ ext {
1414
mavenPublicUrl = 'http://192.168.88.8:8081/nexus/content/repositories/public'
1515
mavenReleaseUrl = 'http://192.168.88.8:8081/nexus/content/repositories/releases'
1616
mavenSnapshotUrl = "http://192.168.88.8:8081/nexus/content/repositories/snapshots"
17-
baseVersion = '1.1.0'
18-
dataVersion = '1.1.0'
17+
baseVersion = '1.1.1'
18+
dataVersion = '1.1.1'
1919
slf4jVersion = '1.7.21'
2020
fastJsonVersion = '1.2.35'
2121
zookeeperVersion = '3.4.6'

skyeye-web/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ apply plugin: 'application'
66

77
group = 'skyeye'
88
applicationName = 'skyeye-web'
9-
version = '1.1.0'
9+
version = '1.1.1'
1010

1111
sourceCompatibility = 1.8
1212
targetCompatibility = 1.8
@@ -24,8 +24,8 @@ repositories {
2424
}
2525

2626
ext {
27-
baseVersion = '1.1.0'
28-
dataVersion = '1.1.0'
27+
baseVersion = '1.1.1'
28+
dataVersion = '1.1.1'
2929
jacksonVersion = '1.9.13'
3030
httpclientVersion = '4.5.2'
3131
fastjsonVersion = '1.2.35'

0 commit comments

Comments
 (0)