Hi folks,
I am running b4jv4.20 on windows 10. I would like to have the non-ui app of mine to get the jetty server to write the log to a file so that I can write something to peruse it. I have done a lot of reading and have tried
from rwblinn, however, I do not seem to be getting anywhere(no pun intended). Looking at the last line in that code I made the assumption that "JettyLog" was a file that would be created somewhere, but being a non-java person I may be totally wrong.
Using the above code I set the level to "INFO" (default) and ran my app from the command line but could not find any trace of "JettyLog". The app ran fine, just no log(that I could find anyway).
I wonder if anyone could enlighten me please.
Thanks,
Hilton.
I am running b4jv4.20 on windows 10. I would like to have the non-ui app of mine to get the jetty server to write the log to a file so that I can write something to peruse it. I have done a lot of reading and have tried
B4X:
'Set Jetty Logging Level
'Parameter: Level. Possible values: ALL|DEBUG|INFO|WARN|OFF
'See: http://download.eclipse.org/jetty/9.3.6.v20151106/apidocs/org/eclipse/jetty/util/log/StdErrLog.html
'Note: Be aware that logging contains important info. Default is INFO
'Example:
'Sub AppStart (Args() As String)
' SetLoggingLevel("OFF")
' srvr.Initialize("srvr")
Sub SetLoggingLevel(level As String)
Log("Set Logging Level to " & level.ToUpperCase)
If level.Length = 0 Then Return
Dim joJ As JavaObject 'Jetty Object
Dim joP As JavaObject 'Properties Object
joP.InitializeNewInstance("java.util.Properties", Null)
joP.RunMethod("setProperty", Array("org.eclipse.jetty.LEVEL", level.ToUpperCase))
joJ.InitializeNewInstance("org.eclipse.jetty.util.log.StdErrLog", Array("JettyLog", joP))
End Sub
from rwblinn, however, I do not seem to be getting anywhere(no pun intended). Looking at the last line in that code I made the assumption that "JettyLog" was a file that would be created somewhere, but being a non-java person I may be totally wrong.
Using the above code I set the level to "INFO" (default) and ran my app from the command line but could not find any trace of "JettyLog". The app ran fine, just no log(that I could find anyway).
I wonder if anyone could enlighten me please.
Thanks,
Hilton.