Permalink
Browse files

Add chunk_size config and defaults.

  • Loading branch information...
1 parent aa0726a commit 145ec45613cb33cc6624cbccafa43ad670cfdb2b @colinmollenhour committed Apr 17, 2012
View
3 app/code/community/Hackathon/Logger/Model/Graylog2.php
@@ -30,6 +30,7 @@ public function __construct($filename)
$helper = Mage::helper('hackathon_logger'); /* @var $helper Hackathon_Logger_Helper_Data */
$this->options['hostname'] = $helper->getLoggerConfig('graylog2/hostname');
$this->options['port'] = $helper->getLoggerConfig('graylog2/port');
+ $this->options['chunk_size'] = $helper->getLoggerConfig('graylog2/chunk_size');
$this->options['filename'] = $filename;
}
@@ -64,7 +65,7 @@ public function shutdown()
// Finally, send the Event, but re-throw any exceptions at the
// proper level of abstraction.
try {
- $graylog2 = new GELFMessagePublisher($this->options['hostname'], $this->options['port']);
+ $graylog2 = new GELFMessagePublisher($this->options['hostname'], $this->options['port'], $this->options['chunk_size']);
$msg = new GELFMessage();
//$msg->setShortMessage('something is broken.');
View
11 app/code/community/Hackathon/Logger/etc/config.xml
@@ -92,4 +92,13 @@
</hackathon_logger>
</blocks>
</global>
-</config>
+ <default>
+ <logger>
+ <graylog2>
+ <hostname>localhost</hostname>
+ <port>12201</port>
+ <chunk_size>1420</chunk_size>
+ </graylog2>
+ </logger>
+ </default>
+</config>
View
13 app/code/community/Hackathon/Logger/etc/system.xml
@@ -167,14 +167,23 @@
<port translate="label">
<label>Port</label>
<frontend_type>text</frontend_type>
- <sort_order>10</sort_order>
+ <sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</port>
+ <chunk_size translate="label">
+ <label>Chunk Size</label>
+ <frontend_type>text</frontend_type>
+ <sort_order>30</sort_order>
+ <show_in_default>1</show_in_default>
+ <show_in_website>1</show_in_website>
+ <show_in_store>1</show_in_store>
+ <comment>This should be 1420 for WAN, 8154 for LAN.</comment>
+ </chunk_size>
</fields>
</graylog2>
</groups>
</logger>
</sections>
-</config>
+</config>

0 comments on commit 145ec45

Please sign in to comment.