-1

I am trying to -D the location of the logback.xml file on the java command line running on a windows machine:

PS C:\testexecclient> java -DpropertyFolder=c:\testexecclient -Dlogback.configurationFile=c:\testexecclient\logback.xml
-jar testexecclient-1.0.jar

The logback.configurationFile property key is causing an issue. Java doesn't seem to like the X.Y format for a property key on a windows machine. It says it can't find the main class. I remove that property key/value and all is good, but I have no logging to a file.

What is the appropriate property key for logback when trying to run on windows machine ?

thanks

glytching
  • 44,936
  • 9
  • 114
  • 120
Walter Kelt
  • 2,199
  • 1
  • 18
  • 22
  • this issue is related to trying to run the java application in powershell. Don't have time to figure out the issue. Runs fine from the DOS prompt. – Walter Kelt Feb 01 '18 at 15:16
  • 1
    At least add a sample of the error message so other people can take advantage of your experience. – LMC Feb 14 '18 at 20:55
  • fair enough....issuing the command above via powershell, I get the following output: Error: Could not find or load main class .configurationFile=c:.testexecclient.logback.xml – Walter Kelt Feb 15 '18 at 02:51

1 Answers1

1

Try this:

java -DpropertyFolder=c:\testexecclient -D"logback.configurationFile=c:\testexecclient\logback.xml"
-jar testexecclient-1.0.jar

Note the quotes.

AAEM
  • 1,837
  • 2
  • 18
  • 26