- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想设置一个日志文件,以便只有 SOAP 范围内的消息才会记录到该文件中。相反,我还想防止在调试和错误的默认日志中记录 SOAP 范围内的消息。
这是我当前在 bootstrap.php 中的设置。
CakeLog::config('soap', array(
'engine' => 'FileLog',
'types' => array('info','debug','error'),
'scopes' => array('soap'),
'file' => 'soap'
));
CakeLog::config('debug', array(
'engine' => 'FileLog',
'types' => array('notice', 'info', 'debug'),
'file' => 'debug',
));
CakeLog::config('error', array(
'engine' => 'FileLog',
'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
'file' => 'error',
));
这是我的一个库中进行 SOAP 调用的片段。
CakeLog::debug("REQUEST:\n" . $client->__getLastRequest() . "\n", 'soap');
CakeLog::debug("RESPONSE:\n" . $client->__getLastResponse() . "\n", 'soap');
} catch (SoapFault $e) {
CakeLog::error(print_r($result,true), 'soap');
CakeLog::error('Exception: (' . $e->getCode() . ') ' . $e->getMessage(), 'soap');
if (isset($client)) {
CakeLog::error("Errored REQUEST:\n" . print_r($client->__getLastRequest(), true) . "\n", 'soap');
}
当我进行当前设置时,我在 debug.log 和soap.log 中收到调试soap 消息,这是不可取的。
最佳答案
根据CakeLog::config documentation
If you don't define any scopes an adapter will catch all scopes that match the handled levels.
因此,调试记录器写入类型为 'types' => array('notice', 'info', 'debug'), 的所有消息,
现在如何避免呢?看来你有两种方法:
使用 CakeLog::write 和自定义错误类型
CakeLog::write('soap', "REQUEST:\n". $client->__getLastRequest() . "\n");
在这种情况下,根据 CakeLog::write method 的文档
integer|string $type Type of message being written. When value is an integer or a string matching the recognized levels, then it will be treated log levels. Otherwise it's treated as scope.
范围和类型将相同并且具有“soap”值,因此,消息不会记录在调试记录器中,而只会记录在soap中。
关于cakephp - CakeLog 和范围 : Restricting scope to only one logger,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17331705/
在 NHibernate 中创建条件时我可以使用 Restriction.In() 或 限制.InG() 它们有什么区别? 最佳答案 InG 是 In 的通用等价物(对于集合) 方法的签名如下(仅显示
我创建了一个 Hibernate (3.5) 条件查询: Criteria criteria = db.getSession().createCriteria(Vendor.class); crite
我对这个指令定义对象感到困惑 - (restrict)。我创建了两个函数,第一个是带有 restrict 的函数,另一个是没有 restrict 的函数。 当我运行此代码时,两个指令返回相同的结果。
这些陈述是否相同?如果我删除 owl:Restriction 会有什么问题吗?和 owl:Class .它们似乎多余,但这总是我在网上看到的例子。 owl:onProperty有域名owl:restr
下面是我开发的表格 create table userevent(id uuid,eventtype text,sourceip text,user text,sessionid text,rolei
这个问题已经有答案了: Access restriction on class due to restriction on required library rt.jar? (15 个回答) Acce
方法说明: Given a list of futures fs, returns the future holding the list of values of all the futures f
我想知道是否可以将 restrict 关键字仅包含在函数定义中,而不是像这样的函数声明中: void foo(char *bar); void foo(char * restrict bar) {
Advertisements advertisements = NHibernateSession.CreateCriteria(typeof(Advertisements))
我有以下结构: typedef struct{ int data[LENGTH]; }Data; 并像这样使用它: Data* dt=CALLOC(...) int foo(Data* res
我有以下结构: typedef struct{ int data[LENGTH]; }Data; 然后像这样使用它: Data* dt=CALLOC(...) int foo(Data* re
有以下结构: typedef struct test_def { int a, b, c; } test_def_t; typedef struct test { test_def_t con
我阅读了标准但仍然不能确定: #include #include void repl(char *restrict ap){ char *cp=strchr(ap,(int)'m');
我注意到在我们的一个遗留项目中大量使用了 restrict 关键字。 我理解 restrict 的基本原理,但我质疑它在应用于其中一些功能时是否有用。 举下面两个例子: void funcA(int
我有以下简单的功能 static inline void minVec(const double *restrict v, double *restrict vmin, unsigned length
添加到 C99 中的 restrict 关键字的主要用途之一是允许编译器将某些内容加载到寄存器中,并假定该寄存器将反射(reflect)如此加载的变量的状态。给定 void foo1(int * re
RESTRICT 和 NO ACTION 在 MySQL FK 中有什么区别?从文档来看,它们似乎完全相同。是这样吗?如果有,为什么两者都有? 最佳答案 来自 MySQL 文档:https://dev
我有一些通过apply from: 'my-build.gradle'应用的Gradle脚本。如果我在外部构建文件my-build.gradle中按如下方式使用新的插件DSL,它将失败并显示以下错误:
我正在浏览 Wikipedia/Restrict , 并发现 The compiler can e.g. rearrange the code, first loading all memory lo
根据eslint no-restricted-imports documentation When using the object form, you can also specify an arr
我是一名优秀的程序员,十分优秀!