Adam Cameron
lucee-server.xml
file directly c) using <cfadmin>
which I... think... is not really supposed to be something user-land is supposed to use?
Can't use cfconfig or anything to do with commandbox in this situation, unfortunately.Adam Cameron
<cflog file="whatEvs">
in CF, CF just goes "oh yeah, that file doesn't exist but I guess it's the first time they're using it so I'll create if for them. It's pretty obvious that'll be what they want here".
The Lucee docs for <cflog>
claims that the file
attrib is not implemented in favour of just using log
, but the log
option needs the log to already be configured. So: not really the same.
But is there any way to get Lucee to go "oh yeah, that file doesn't exist but I guess it's the first time they're using it so I'll create if for them. It's pretty obvious that'll be what they want here" rather than "NEIN! YOU MUST CONFIGURE IT FIRST!!!"Adam Cameron
<cfadmin>
doesn't handle log config anyhow 😕
(ref: https://docs.lucee.org/guides/Various/cfadmin.html)bdw429s
05/11/2022, 4:36 PMbdw429s
05/11/2022, 4:36 PMbdw429s
05/11/2022, 4:37 PMAdam Cameron
<cflog log="somethingAlreadyConfigured">
and <cflog file="adHocFileName">
on CF. Lucee decided not to implement the latter it seems. Kinda seems like a CF compat bug now that I am annoyed by the situation 😉Adam Cameron
If you can wade through the Lucee admin CFM filesDude I thought we were mates. Don't suggest I self-harm like that.
Adam Cameron
Adam Cameron
<cfadmin>
or (any other mechanism) was maintaining these settings. Obvs they're being maintained somehow, but I guess my patience for grokking how Lucee's source code works is not... erm... enough. I will try again though.Adam Cameron
Adam Cameron
local.admin = new Administrator("web", server.system.environment.ADMINPASSWORD)
admin.updateLogSettings(
name = "AdamTest",
level = "ERROR",
appenderClass = "lucee.commons.io.log.log4j2.appender.ResourceAppender",
layoutClass = "lucee.commons.io.log.log4j2.layout.ClassicLayout",
appenderArgs = {
maxfiles = 20,
maxfilesize = 1073741824
}
)
writeLog(log="AdamTest", type="ERROR", text="ERROR SHOULD BE LOGGED")
writeLog(log="AdamTest", type="INFO", text="INFO SHOULD NOT BE LOGGED")
cfsimplicity
08/11/2022, 11:52 AM