stubotnik
stubotnik

Reputation: 1982

Log UTF-8 characters in ColdFusion

Is it possible to get ColdFusion to log UTF-8 data (eg: Chinese characters) using <cflog>?

By default it just logs questions marks instead of the characters.

I know I could open/write/close the log file using the file API, but I'm don't want to over-complicate something as simple as logging.

Upvotes: 3

Views: 568

Answers (2)

barnyr
barnyr

Reputation: 5678

You may also be able to set log4j.appender.LOGFILE.encoding=UTF-8 in ColdFusion's /lib/log4j.properties file and not affect the whole VM. Although if Adam's solution works, I'd not necessarily change it.

Upvotes: 2

Adam Cameron
Adam Cameron

Reputation: 29870

Yeah, but you need to tell your entire JVM to process files as UTF-8. You can do this via adding this to your java.args in jvm.config:

-Dfile.encoding=utf8

Reference.

Upvotes: 5

Related Questions