Skip to content

Commit

Permalink
remove startup logging from core (CFMLEngine), it is now in loader
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Dec 17, 2024
1 parent fd773c1 commit 954a753
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 39 deletions.
30 changes: 0 additions & 30 deletions core/src/main/java/lucee/runtime/engine/CFMLEngineImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,36 +223,6 @@ public static CFMLEngineFactory FACTORY() {
}

private CFMLEngineImpl(CFMLEngineFactory factory, BundleCollection bc) {
String dumpPath = Caster.toString(SystemUtil.getSystemPropOrEnvVar("lucee.dump.threads", null), null);
if (!StringUtil.isEmpty(dumpPath, true)) {
int interval = Caster.toIntValue(SystemUtil.getSystemPropOrEnvVar("lucee.dump.threads.interval", null), 100);
long start = System.currentTimeMillis();
long max = Caster.toIntValue(SystemUtil.getSystemPropOrEnvVar("lucee.dump.threads.max", null), 10000);

// Create a new thread to run the task
Thread thread = new Thread(() -> {
while (true) {
try {
if ((start + max) < System.currentTimeMillis()) {
break;
}
// Call the dumpThreadPositions method
Controler.dumpThreadPositions(dumpPath);

// Pause for the specified interval
SystemUtil.sleep(interval);
}
catch (IOException e) {
e.printStackTrace();
SystemUtil.sleep(1000);
}
}
});

// Start the thread
thread.start();
}

FACTORY = this.factory = factory;
this.bundleCollection = bc;

Expand Down
8 changes: 1 addition & 7 deletions core/src/main/java/lucee/runtime/engine/Controler.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import lucee.commons.io.log.Log;
import lucee.commons.io.log.LogUtil;
import lucee.commons.io.res.Resource;
import lucee.commons.io.res.ResourcesImpl;
import lucee.commons.io.res.filter.ExtensionResourceFilter;
import lucee.commons.io.res.filter.ResourceFilter;
import lucee.commons.io.res.util.ResourceUtil;
Expand Down Expand Up @@ -197,8 +196,7 @@ else if (time > TIMEOUT) {
}
}

public static void dumpThreadPositions(String path) throws IOException {
Resource target = ResourcesImpl.getFileResourceProvider().getResource(path);
public static void dumpThreadPositions(Resource target) throws IOException {

StackTraceElement[] stes;
String line;
Expand Down Expand Up @@ -238,10 +236,6 @@ private static void dumpThreads() {

}

public static void main(String[] args) throws IOException {
dumpThreadPositions("/Users/mic/Tmp3/tmp/data.jsonl");
}

private void control(CFMLFactoryImpl[] factories, boolean firstRun, Log log) {
long now = System.currentTimeMillis();
boolean do10Seconds = last10SecondsInterval + 10000 < now;
Expand Down
2 changes: 1 addition & 1 deletion loader/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project default="core" basedir="." name="Lucee"
xmlns:resolver="antlib:org.apache.maven.resolver.ant">

<property name="version" value="6.2.0.218-SNAPSHOT"/>
<property name="version" value="6.2.0.219-SNAPSHOT"/>

<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
<classpath>
Expand Down
2 changes: 1 addition & 1 deletion loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.lucee</groupId>
<artifactId>lucee</artifactId>
<version>6.2.0.218-SNAPSHOT</version>
<version>6.2.0.219-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down

0 comments on commit 954a753

Please sign in to comment.