-
Notifications
You must be signed in to change notification settings - Fork 7.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't print log to sentinel-record.log file with log4j JDK logging adapter #975
Comments
Hi, are there any error messages in your stderr? |
No. Besides, I set the log home by
|
It's unrelated. I test it by setting log home on my computer and don't set it on server. |
You mean on your computer you can see the log, and on server can not see? If so, it seems your application has not the write permission for the log dir. |
@linlinisme I checked it, my application has permission, the metrics log is normal, and metrics log is in same directory with record log. |
Could you please try to add this JVM parameter: |
It seems there are some bad configuration in my code, record log is ok when I run my code in IDE, but it will not appear if I package my code and run it on server. |
What means if the log doesn't appear in stdout? It does. |
Any progress? |
Maybe not. I use log4j in my service and I try to remove the |
If you just want to redirect all logs into console under log4j2 I have an easier way to achieve that. reference in pom.xml: <dependency>
<groupId>com.yoloho.enhanced</groupId>
<artifactId>enhanced-common</artifactId>
<version>1.0.2</version>
</dependency> And you can just remove the // enable console, disable file logging
Logging.initLogging(true, false); If you want do it more elegant you can refer to |
Sentinel provide a VM argument to choose output of biz log.
If set |
Has this been resolved? |
Sorry, I'm busy recently and I'll find time to do it. |
@sczyh30 I add this to my <Logger name="cspSentinelRecordLog" level="DEBUG" additivity="false">
<AppenderRef ref="Main"/>
</Logger> I'm not familiar with log framework, does log framework cause this? |
You may check whether the content of Sentinel record log appeared in the log4j-configured log file. |
There's not, only appeared when I add a logger named |
Has this been solved? |
no, I think there's something wrong in the log framework properties, and had other people report the same question? |
I debug it again, and find the root cause is that there's not any Is there somethint wrong in sentinel |
@sczyh30 I maybe have found the reason from the log4j official website:
|
Since 1.7.2 you may leverage the |
[RIP-9] Polish Example_Orderly.md
Describe what happened (or what feature you want)
I use nacos as dynamic rule center, and change rule in nacos console, i also receive the new rule, but can't see anything in
sentinel-record.log
file, is there some special config params?There are 2 record log file, they are empty all:
But the metrics.log is right.
And more, I run the code on my computer, and can see log, but deploy it to server, it will not.
Tell us your environment
Nacos client version is 1.0.0
Sentinel version is 1.6.2
The text was updated successfully, but these errors were encountered: