Skip to content

Commit

Permalink
Merge pull request #114 from newrelic/fix/CTE_IOStreamHelper
Browse files Browse the repository at this point in the history
Fix ClassNotFoundException for IOStreamHelper
  • Loading branch information
lovesh-ap authored Oct 5, 2023
2 parents 15a9367 + 90490ec commit 2bb58e9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.newrelic.api.agent.weaver.Weave;
import com.newrelic.api.agent.weaver.WeaveAllConstructors;
import com.newrelic.api.agent.weaver.Weaver;
import com.newrelic.agent.security.instrumentation.inputstream.IOStreamHelper;
import com.newrelic.api.agent.security.instrumentation.helpers.IOStreamHelper;

@Weave(type = MatchType.BaseClass, originalName = "java.io.BufferedReader")
public abstract class BufferedReader_Instrumentation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.newrelic.api.agent.weaver.MatchType;
import com.newrelic.api.agent.weaver.Weave;
import com.newrelic.api.agent.weaver.Weaver;
import com.newrelic.agent.security.instrumentation.inputstream.IOStreamHelper;
import com.newrelic.api.agent.security.instrumentation.helpers.IOStreamHelper;

@Weave(type = MatchType.BaseClass, originalName = "java.io.OutputStream")
public abstract class OutputStream_Instrumentation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.newrelic.api.agent.security.NewRelicSecurity;
import com.newrelic.api.agent.security.instrumentation.helpers.GenericHelper;
import com.newrelic.api.agent.weaver.*;
import com.newrelic.agent.security.instrumentation.inputstream.IOStreamHelper;
import com.newrelic.api.agent.security.instrumentation.helpers.IOStreamHelper;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.newrelic.api.agent.weaver.MatchType;
import com.newrelic.api.agent.weaver.Weave;
import com.newrelic.api.agent.weaver.Weaver;
import com.newrelic.agent.security.instrumentation.inputstream.IOStreamHelper;
import com.newrelic.api.agent.security.instrumentation.helpers.IOStreamHelper;

@Weave(type = MatchType.BaseClass, originalName = "java.io.Reader")
public abstract class Reader_Instrumentation {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package com.newrelic.agent.security.intcodeagent.schedulers;

import com.newrelic.agent.security.intcodeagent.filelogging.FileLoggerThreadPool;
import com.newrelic.agent.security.intcodeagent.filelogging.LogFileHelper;
import com.newrelic.agent.security.intcodeagent.filelogging.LogLevel;
import com.newrelic.agent.security.intcodeagent.logging.IAgentConstants;
import com.newrelic.agent.security.util.IUtilConstants;
import com.newrelic.api.agent.NewRelic;

import java.util.Map;
import java.util.concurrent.*;
Expand Down Expand Up @@ -63,4 +67,15 @@ public ScheduledFuture<?> scheduleLowSeverityFilterCleanup(Runnable command,
return future;
}

public ScheduledFuture<?> scheduleDailyLogRollover(Runnable command) {
logger.log(LogLevel.INFO, "Start ", SchedulerHelper.class.getName());
if(LogFileHelper.isDailyRollover()) {
int period = NewRelic.getAgent().getConfig().getValue(IUtilConstants.NR_LOG_DAILY_ROLLOVER_PERIOD, 24);
ScheduledFuture<?> future = commonExecutor.scheduleWithFixedDelay(command, period, period, TimeUnit.HOURS);
scheduledFutureMap.put("daily-log-rollover", future);
return future;
}
return null;
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.newrelic.agent.security.instrumentation.inputstream;
package com.newrelic.api.agent.security.instrumentation.helpers;

import com.newrelic.api.agent.security.NewRelicSecurity;
import com.newrelic.api.agent.security.instrumentation.helpers.GenericHelper;
Expand Down

0 comments on commit 2bb58e9

Please sign in to comment.