OpenLiberty / liberty-tools-eclipse

Eclipse Public License 2.0
11 stars 8 forks source link

SVT: Server.xml Logging Format gives the following error when env variable is used #467

Closed danielguinan1 closed 10 months ago

danielguinan1 commented 10 months ago

In my application I have the logging set to be configurable with environment variables:

<logging 
    consoleFormat="${LOGGING_FORMAT}" 
    consoleSource="message,trace,accessLog,ffdc,audit" 
    messageFormat="${LOGGING_FORMAT}" 
    messageSource="message,trace,accessLog,ffdc,audit" 
    traceSpecification="${TRACE_SPEC}" />

Which gives the following errors:

Multiple markers at this line
- Value '${LOGGING_FORMAT}' is not in the enumeration list.

It must be one of the following:
 - DEV
 - SIMPLE
 - TBASIC
 - JSON

Code:
- Value '${LOGGING_FORMAT}' is not in the enumeration list.

It must be one of the following:
 - SIMPLE
 - TBASIC
 - JSON

Code:
- cvc-attribute.3: The value '${LOGGING_FORMAT}' of attribute 'messageFormat' on element 'logging' is not valid with respect to its type, '#AnonType_messageFormatcom.ibm.ws.logging'.
cvc-attribute.3: The value '${LOGGING_FORMAT}' of attribute 'consoleFormat' on element 'logging' is not valid with respect to its type, '#AnonType_consoleFormatcom.ibm.ws.logging'.

I can see it is fine with env variables in another spec area, but just not this one:

    <accessLogging 
      enabled="${ACCESS_LOGGING_ENABLED}" 
      filepath="${server.output.dir}/logs/http_defaultEndpoint_access.log" 
      logFormat='%h %u %t "%r" %s %b %D %{User-agent}i'>
    </accessLogging>

I am using RHEL 9.1 and 2023-09 Eclipse.

danielguinan1 commented 10 months ago

This may or may not be related, but I also get this under httpEndpoint.accessLogging

cvc-complex-type.3.2.2: Attribute 'filepath' is not allowed to appear in element 'accessLogging'.

Which prompts me to remove filepath. However when I delete a character and re-add it seems to pick it up, but still mark as not found. Screenshot 2023-10-30 at 2 51 45 PM

cherylking commented 10 months ago

Just tried all of these in VS Code and get no diagnostics/errors on those elements/attributes.

cherylking commented 10 months ago

@danielguinan1 For filepath error, you need to change to filePath (camel case).

cherylking commented 10 months ago

Closing as working as designed. There was an old .xsd file causing the issue. A clean of the project gets the new improved behavior.