| @@ 91-104 (lines=14) @@ | ||
| 88 | * ログレベルを読み込む |
|
| 89 | * @throws LoggerException |
|
| 90 | */ |
|
| 91 | private function loadLogLevel() |
|
| 92 | { |
|
| 93 | if (!array_key_exists("level", $this->configMap)) { |
|
| 94 | throw new LoggerException("Log level must be defined."); |
|
| 95 | } |
|
| 96 | ||
| 97 | $logLevel = $this->toLogLevelValue($this->configMap["level"]); |
|
| 98 | if ($logLevel === 0) { |
|
| 99 | throw new LoggerException("Invalid log level: " . $this->configMap["level"]); |
|
| 100 | } |
|
| 101 | $this->logContainer->logLevel = $logLevel; |
|
| 102 | ||
| 103 | return $this; |
|
| 104 | } |
|
| 105 | ||
| 106 | /** |
|
| 107 | * ログ保存先パスを読み込む |
|
| @@ 129-141 (lines=13) @@ | ||
| 126 | * ログローテートサイクルを読み込む |
|
| 127 | * @throws LoggerException |
|
| 128 | */ |
|
| 129 | private function loadRotateCycle() |
|
| 130 | { |
|
| 131 | if (array_key_exists("rotate_cycle", $this->configMap)) { |
|
| 132 | $rotateCycle = $this->cycle2value($this->configMap["rotate_cycle"]); |
|
| 133 | // 妥当なローテートサイクルか |
|
| 134 | if ($rotateCycle === 0) { |
|
| 135 | throw new LoggerException("Invalid log rotate cycle: " . $this->configMap["rotate_cycle"]); |
|
| 136 | } |
|
| 137 | $this->logContainer->rotateCycle = $rotateCycle; |
|
| 138 | } |
|
| 139 | ||
| 140 | return $this; |
|
| 141 | } |
|
| 142 | ||
| 143 | /** |
|
| 144 | * ログローテートサイズを読み込む |
|
| @@ 147-159 (lines=13) @@ | ||
| 144 | * ログローテートサイズを読み込む |
|
| 145 | * @throws LoggerException |
|
| 146 | */ |
|
| 147 | private function loadRotateSize() |
|
| 148 | { |
|
| 149 | if (array_key_exists("rotate_size", $this->configMap)) { |
|
| 150 | $rotateSize = intval($this->configMap["rotate_size"]); |
|
| 151 | // ローテートサイズが不正の場合(正の整数以外の値が設定された場合) |
|
| 152 | if ($rotateSize <= 0) { |
|
| 153 | throw new LoggerException("Invalid log rotate size: " . $this->configMap["rotate_size"]); |
|
| 154 | } |
|
| 155 | $this->logContainer->rotateSize = $rotateSize; |
|
| 156 | } |
|
| 157 | ||
| 158 | return $this; |
|
| 159 | } |
|
| 160 | ||
| 161 | /** |
|
| 162 | * アプリケーション名を読み込む |
|