Skip to content

Commit

Permalink
Rebased the branch
Browse files Browse the repository at this point in the history
  • Loading branch information
vasireddy99 committed Oct 10, 2023
1 parent 287678e commit 4e64893
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.nio.file.Path;
import java.nio.file.Files;
import java.net.URISyntaxException;
import java.time.Duration;
import java.time.Instant;
Expand Down Expand Up @@ -83,17 +87,19 @@ private GenericContainer<?> createAndStartCollector(String configFilePath, Strin
// collector.withCommand("sh", "-c", "chmod -R a+rw " + "/logs");

collector.start();
collector.waitingFor(Wait.forHealthcheck());
// collector.waitingFor(Wait.forHealthcheck());
return collector;
}

LogsTests() throws Exception {
}
@Test
void testSyslog() throws Exception {
String logStreamName = "rfcsyslog-logstream-" + uniqueID;
collector = createAndStartCollector("/configurations/config-rfcsyslog.yaml", "/logs/RFC5424.log", logStreamName);

List<String> logFilePaths = new ArrayList<>();
logFilePaths.add("/logs/testingJSON.log");
logFilePaths.add("/logs/RFC5424.log");
validateLogs(logStreamName , logFilePaths, true);
collector.stop();
}
Expand All @@ -104,7 +110,7 @@ void testLog4j() throws Exception {
collector = createAndStartCollector("/configurations/config-log4j.yaml", "/logs/log4j.log", logStreamName);

List<String> logFilePaths = new ArrayList<>();
logFilePaths.add("/logs/testingJSON.log");
logFilePaths.add("/logs/log4j.log");
validateLogs(logStreamName , logFilePaths, true);
collector.stop();
}
Expand Down Expand Up @@ -176,7 +182,7 @@ void testCollectorRestartAfterCrash() throws Exception {
@Test
void testFileRotation() throws Exception {
String logStreamName = "fileRotation-logstream-" + uniqueID;
String resourceFilePath = "/logs/filerotationlogs/log4j.log"; // Path to the resource file
String resourceFilePath = "/logs/log4j.log"; // Path to the resource file
collector = createAndStartCollector("/configurations/config-fileRotation.yaml", resourceFilePath, logStreamName);

Thread.sleep(10000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ exporters:
log_group_name: "adot-testbed/logs-component-testing/logs"
log_stream_name: ${LOG_STREAM_NAME}
log_retention: 7
raw_log: true

service:
pipelines:
logs:
receivers: [filelog]
exporters: [logging,awscloudwatchlogs]
exporters: [awscloudwatchlogs]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
extensions:
file_storage:
directory: /logs/

receivers:
filelog:
include: [/logs/storageExtension.log]
storage: file_storage

exporters:
awscloudwatchlogs:
log_group_name: "adot-testbed/logs-component-testing/logs"
log_stream_name: ${LOG_STREAM_NAME}
log_retention: 7

service:
extensions: [ file_storage ]
pipelines:
logs:
receivers: [filelog]
exporters: [awscloudwatchlogs]

This file was deleted.

Empty file.

0 comments on commit 4e64893

Please sign in to comment.