Comments (4)
- SpaceId这个设置之后是和配置文件相对应的么?
答:是的。SpaceId 的 name 是和配置文件路径一一对应的,参考文档 。如果,你的 SpaceId 是 com.alipay.sofa.app
,那么对应的配置文件路径应该是:
└── com
└── alipay
└── sofa
└── app
└── log
├── log4j
│ └── log-conf.xml
├── log4j2
│ └── log-conf.xml
└── logback
└── log-conf.xml
@KevinHe666 对了,建议你的 SpaceId 取得名字是自己应用实际的含义,一是避免和其他人的冲突,二是也有一定的业务含义。
- 是这个意思。但是,代码可以再优雅下哈,只在需要改变级别的地方去调用这个方法改线级别并获取实例即可。在正常不需要获取级别的时候,直接通过此方法获取实例即可:
public static Logger getLoggerBySpace(String name, SpaceId spaceId)
这样,可以避免每次都相应日志实现界别修改的性能损耗。
from sofa-common-tools.
from sofa-common-tools.
@guanchao-yang 😆十分感谢您的耐心解答,使用中有不懂的地方还望您指点
from sofa-common-tools.
@KevinHe666 有问题,随时沟通哈,互相学习
from sofa-common-tools.
Related Issues (20)
- 支持单独配置终端日志级别 HOT 4
- LogEnvUtils will cause java.util.ConcurrentModificationException
- DefaultConfigManger will cause concurrent problem
- Better logger name where there are no known logging backend provided
- Add Public Access Modifiers to ExecutingRunnable
- Local console logger support prefix match
- Why logger init logs only printed on debug level?
- What is the alternative class of RecordContext?
- MutiAppLoggerSpaceManager should use caller classloader default
- Tools itself logging problem HOT 1
- Support for JDK/Spring ThreadPoolExecutor logging of decayed tasks HOT 1
- getCallerClassLoader gets wrong classloader
- bug in SofaThreadPoolTaskExecutor threadPoolName setter
- XML configuration file are very redunant
- Using of SimpleDateFormat in multi-thread environment is unsafe
- Terminate the support of JDK 6
- Not support print stack when executing one runnable in different thread
- 对于三方包, 如何重定向二方包的日志输出? HOT 1
- Use dependencyManagement and properties to manage all dependencies
- Refactor the thread pool module
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sofa-common-tools.