2012-06-25 91 views
1

任何一個可以解釋發出指示php.ini配置

; Do not log repeated messages. Repeated errors must occur in same file on same 
; line unless ignore_repeated_source is set true. 
; http://php.net/ignore-repeated-errors 
ignore_repeated_errors = off 

; Ignore source of message when ignoring repeated messages. When this setting 
; is On you will not log errors with repeated messages from different files or 
; source lines. 
; http://php.net/ignore-repeated-source 
ignore_repeated_source = off 
+2

這是試圖減少日誌的大小,只記錄該類型的一個錯誤,如果他們是重複的。 ignore_repeated_erorrs是有用的,因爲它只關心那個文件是什麼,但要知道如果你在多行上得到錯誤,那麼關閉它可能會很好。重複刪除有時會很有用,但我更願意看到每個發生錯誤的文件。 – Sammaye

回答

1

下面這些之間的相互關係,從PHP Documentation

ignore_repeated_errors
不要記錄重複的消息。除非ignore_repeated_source設置爲true,否則重複的錯誤必須發生在同一行的同一文件中。

ignore_repeated_source
忽略重複消息時忽略消息來源。當此設置爲On時,您將不會記錄來自不同文件或源代碼行的重複消息的錯誤。

ignore_repeated_errorsOn當它們來自同一文件的同一行時,將抑制相同錯誤的多次發生。

設置ignore_repeated_sourceOn以及將抑制同樣的錯誤的多次出現,即使他們來自不同的文件不同的線路。

1

重複的消息是在同一文件的同一行上創建的消息。這可以是循環或功能:

for (...) { 
    someFunctionThatFails(); 
} 

通過啓用第二個選項,重複的消息不需要在同一行或文件中。每個請求只會記錄一次某種類型的消息。這將只給出一個登錄的消息:

someFunctionThatFails(); 
doSomeThingElse(); 
someFunctionThatFails();