Yo I'm trying to "locate" my `logs/server.out.txt`...
# box-products
a
Yo I'm trying to "locate" my
logs/server.out.txt
file via code. For me it's in
/usr/local/lib/serverHome/logs/server.out.txt
.
/usr/local/lib/serverHome
is the value of the
BOX_SERVER_APP_SERVERHOMEDIRECTORY
environment variable. Am I safe to ass-u-me that the
logs
subdir will be created off that, and that this is where
server.out.txt
will be? IE so
pathToStdOutFile = "#server.system.environment.BOX_SERVER_APP_SERVERHOMEDIRECTORY#/logs/server.out.txt"
is a legit approach?
b
@Adam Cameron FWIW, the`BOX_SERVER_APP_SERVERHOMEDIRECTORY` env var isn't necessarily guaranteed to be defined in all CommandBox servers, but assuming it will be for you, yes your assumptions are safe.
You can get the same dir from the CLI like so
Copy code
server info property=logDir
though I realize that doesn't help you from inside the actual running server.
👍 1
a
Still good to know, cheers