create contain file log coldfusion

后端 未结 2 1028
天命终不由人
天命终不由人 2021-01-14 22:25

I want create a log file. I tried but its show me an error. Can anyone help? I show my full code here:

http://pastebin.com/SxAMCUnv

Please see this line. I d

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-14 22:56

    A few things.

    1. When you are getting an error: tell us what the error is, don't simply say you got one.
    2. When you're posting code, only post code that's relevant to your situation, don't post all the code. You've given us almost 200 lines of code to wade through, almost all of it not being relevant.
    3. You've given no indication of what troubleshooting of your own you've done here. It's basically like you're asking us to simply do your work for you.

    If you clarify your question, I'll take my down vote off.

    A superficial glance at your code suggests you're trying to write out a variable fileContent, but at no point do you actually set that variable. Without seeing the error, there;s no way of knowing if that's the problem, or the variable is being created in code that you haven't included.

    Another consideration is that you're re-inventing the wheel slightly here. ColdFusion has an inbuilt tag or writeLog() statement for writing to log files.

    =====

    UPDATE (based on updates to the question) That's a compile error you're getting, and the line that's erroring is not the line you indicated in your code (@ pastebin), which is a bit odd. Can you confirm line 213 is that line? And can you reproduce that line in its entirety (the snippet you quoted was incomplete). But basically the error message is telling you what's wrong: you have a syntax error in your code. It could be in the specific statement the error message says (line and column), although sometimes depending on the code, the CF compiler can get confused and a syntax error in a preceding line might be reported as being further down the file than it actually is. But for starters, post the whole line of code, not just the first bit of it.

提交回复
热议问题