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