<div dir="ltr"><div dir="ltr">Hello Ceki,<div><br></div><div>thank you for your answer! I tried your examples but no luck. Actually now I think the error that is given to me mentions that any entry starting with "java:*" will be not read. The message is in german but I translated it:<br><br><p class="MsoNormal" style="line-height:27pt;background:rgb(248,249,250);margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:10pt;color:rgb(32,33,36)">ERROR in
ch.qos.logback.classic.joran.action.InsertFromJNDIAction - Failed to lookup
JNDI env-entry [java:global/stibam] javax.naming.NamingException: CWNEN1000E: A
JNDI operation for a java:comp/env- Names cannot be executed because the
current thread is not associated with a Java EE (Java Enterprise Edition)
application component. </span><span lang="EN" style="font-size:10pt;color:rgb(32,33,36)">This condition can occur when
the JNDI client using the java:comp/env name is not in the thread of a server
application request. Ensure that a Java EE application does not perform JNDI
operations on java:comp/env names in static code blocks or in threads created
by that application. Such code is not necessarily executed in a server
application request thread and is therefore not supported by JNDI operations on
java:comp/env names.</span><span lang="EN-US" style="font-size:10pt;color:rgb(32,33,36)"></span></p></div></div><br><div class="gmail_quote"><div class="gmail_attr">As a workaround, to not having to use JNDI, I just used the actual filepath in the logback.xml as:<br><File>"${server.output.dir}logs/log-output.log</File><br><br></div><div class="gmail_attr">Which solves the first problem but now logback doesn't seem to be able to acces the file (if i copy and paste the filepath from the log output following I can open that file with explorer):. If I start my program I get the following log output.</div><div class="gmail_attr"><br>23:16:12,543 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[RollApp] - Active log file name: "F:/server/wlp-ev-21.0.0.11/usr/servers/defaultServer/logs/log-output.log<br>23:16:12,543 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[RollApp] - File property is set to ["F:/server/wlp-ev-21.0.0.11/usr/servers/defaultServer/logs/log-output.log]<br>23:16:12,546 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[RollApp] - Failed to create parent directories for [F:\server\wlp-ev-21.0.0.11\usr\servers\defaultServer\"F:\server\wlp-ev-21.0.0.11\usr\servers\defaultServer\logs\log-output.log]<br>23:16:12,547 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[RollApp] - openFile("F:/server/wlp-ev-21.0.0.11/usr/servers/defaultServer/logs/log-output.log,true) call failed. java.io.FileNotFoundException: "F:\server\wlp-ev-21.0.0.11\usr\servers\defaultServer\logs\log-output.log (Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch)<br>  at java.io.FileNotFoundException: "F:\server\wlp-ev-21.0.0.11\usr\servers\defaultServer\logs\log-output.log (Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch)<br>       at      at java.io.FileOutputStream.open0(Native Method)<br></div><div class="gmail_attr"><br></div><div class="gmail_attr"><br></div><div class="gmail_attr">I guess this has more to do with my project setup now.</div><div class="gmail_attr"><br></div><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr" class="gmail_attr">On Wed, Mar 30, 2022 at 8:22 PM Ceki Gülcü <<a href="mailto:ceki@qos.ch">ceki@qos.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Hello Hendrik,<br>
<br>
The new JNDI naming restriction is intended to prevent malicious JNDI<br>
attacks in configuration files.<br>
<br>
Do you know which Jakarta/EE/JavaEE specification WebSphere Liberty 21<br>
implements? I would suggest reading section "Application Component<br>
Environment Namespace" in the relevant document.<br>
<br>
You might try to use one of the following namespaces:<br>
<br>
 java:comp, java:module, java:app, java:global<br>
<br>
with and without the env/ suffix.<br>
<br>
<br>
-- <br>
Ceki Gülcü<br>
<br>
Sponsoring SLF4J/logback/reload4j at <a href="https://github.com/sponsors/qos-ch" rel="noreferrer" target="_blank">https://github.com/sponsors/qos-ch</a><br>
<br>
On 3/30/2022 3:01 PM, Hendrik Stichweh wrote:<br>
> I'm running a program on a WebSphere Liberty 21.0.0.11 with logging from<br>
> logback 1.2.11.<br>
> <br>
> I have a log output folder specified in my server.xml as: <jndiEntry<br>
> jndiName="logging/logPath" value="${server.output.dir}/logs"/><br>
> <br>
> In the logback.xml I read this entry with the line: <insertFromJNDI<br>
> env-entry-name="logging/logPath" as="logPath"/><br>
> <br>
> This worked in the old logback versions However in the new version of<br>
> logback this name is not allowed as the name now must start with "java:".<br>
> <br>
> So when I tried to change the line to: <insertFromJNDI<br>
> env-entry-name="java:comp/env/logging/logPath" as="logPath"/><br>
> <br>
> I get<br>
> <br>
> |14:37:59,720 |-ERROR in<br>
> ch.qos.logback.classic.joran.action.InsertFromJNDIAction - Failed to<br>
> lookup JNDI env-entry [java:comp/env/stibam/logPath]<br>
> javax.naming.NamingException: CWNEN1000E: |<br>
> <br>
> Is there an error in my reading out of that JNDI variable?<br>
> <br>
_______________________________________________<br>
logback-user mailing list<br>
<a href="mailto:logback-user@qos.ch" target="_blank">logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a></blockquote></div></div>