<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de-DE">
  <title>bitlabor.net</title>
  <link rel="self">https://bitlabor.net/posts.atom</link>
  <link>https://bitlabor.net</link>
  <updated>2008-02-19T16:00:43+00:00</updated>
  <author>
    <name>pattex</name>
  </author>
  <id>tag:bilabor.ne,2008-02-19:/posts</id>
  <entry>
    <title>Ruby on Rails ohne Protokollierung von IP-Adressen</title>
    <link>https://bitlabor.net&lt;a href="/posts/2-Ruby-on-Rails-ohne-Protokollierung-von-IP-Adressen.html"&gt;Ruby on Rails ohne Protokollierung von IP-Adressen&lt;/a&gt;</link>
    <id>tag:bilabor.ne,2008-02-19:/posts/2</id>
    <updated>2008-02-19T16:00:43+00:00</updated>
    <content type="html">&lt;p&gt;&lt;p&gt;
&lt;br /&gt;	Die erste Zeile jedes Log-Eintrags einer normalen Railsanwendung sieht ungef&#228;hr so aus:
&lt;br /&gt;&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;&lt;code&gt;Processing PostsController#index (for 123.123.123.123 at 2008-02-19 14:54:27) [GET]&lt;/code&gt;&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;
&lt;br /&gt;	Bei jeder Anfrage wird die IP-Adresse des anfragenden Rechners zusammen mit dem Zeitpunkt der Anfrage gespeichert.
&lt;br /&gt;&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;
&lt;br /&gt;	Mich interessieren diese Daten allerdings nicht. Viel mehr bin ich der Meinung, dass sie mich einfach mal nichts angehen, zumal auch beim Betreiben von Websites das Gebot der &lt;a href="http://de.wikipedia.org/wiki/Datensparsamkeit_und_Datenvermeidung" title="Datensparsamkeit und Datenvermeidung - Wikipedia"&gt;Datensparsamkeit&lt;/a&gt; gilt. Und nur weil es von der breiten Masse ignoriert wird, ist es damit ja noch lange nicht aufgehoben.
&lt;br /&gt;&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;
&lt;br /&gt;	Der Standard Logger von Ruby on Rails bietet keine M&#246;glichkeit, die Protokollierung dieser Daten abzuschalten. Doch gl&#252;cklicherweise l&#228;sst sich die verantwortliche Funktion einfach &#252;berschreiben, Ruby sei Dank.
&lt;br /&gt;&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;
&lt;br /&gt;	Da ich IP-Logging in meiner Entwicklungs- und Testumgebung eventuell tats&#228;chlich haben will, &#252;berschreibe ich die Funktion in der Datei &lt;em&gt;config/environments/production.rb&lt;/em&gt;, so dass nur im eigentlichen "Produktionsbetrieb" keine Protokollierung stattfindet.
&lt;br /&gt;&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;pre class="textmate-source pattex"&gt;&lt;span class="source source_ruby"&gt;&lt;span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby"&gt;#&lt;/span&gt; Overwrite ActionController::Base.log_processing to prevent IP-Logging
&lt;br /&gt;&lt;/span&gt;&lt;span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby"&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_ruby"&gt;#&lt;/span&gt; config/environments/production.rb
&lt;br /&gt;&lt;/span&gt;&lt;span class="meta meta_class meta_class_ruby"&gt;&lt;span class="keyword keyword_control keyword_control_class keyword_control_class_ruby"&gt;class&lt;/span&gt; &lt;span class="entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby"&gt;ActionController::Base&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;  &lt;span class="meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby"&gt;&lt;span class="keyword keyword_control keyword_control_def keyword_control_def_ruby"&gt;def&lt;/span&gt; &lt;span class="entity entity_name entity_name_function entity_name_function_ruby"&gt;log_processing&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;    &lt;span class="keyword keyword_control keyword_control_ruby"&gt;if&lt;/span&gt; logger
&lt;br /&gt;      logger&lt;span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby"&gt;.&lt;/span&gt;info &lt;span class="string string_quoted string_quoted_double string_quoted_double_ruby"&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby"&gt;"&lt;/span&gt;&lt;span class="constant constant_character constant_character_escape constant_character_escape_ruby"&gt;\n\n&lt;/span&gt;Processing &lt;span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"&gt;&lt;span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby"&gt;#{&lt;/span&gt;controller_class_name&lt;span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="constant constant_character constant_character_escape constant_character_escape_ruby"&gt;\#&lt;/span&gt;&lt;span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"&gt;&lt;span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby"&gt;#{&lt;/span&gt;action_name&lt;span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby"&gt;}&lt;/span&gt;&lt;/span&gt; (&lt;span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"&gt;&lt;span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby"&gt;#{&lt;/span&gt;&lt;span class="support support_class support_class_ruby"&gt;Time&lt;/span&gt;&lt;span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby"&gt;.&lt;/span&gt;now&lt;span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby"&gt;.&lt;/span&gt;to_s&lt;span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby"&gt;(&lt;/span&gt;&lt;span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby"&gt;:&lt;/span&gt;db&lt;/span&gt;&lt;span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby"&gt;)&lt;/span&gt;&lt;span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby"&gt;}&lt;/span&gt;&lt;/span&gt;) [&lt;span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"&gt;&lt;span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby"&gt;#{&lt;/span&gt;request&lt;span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby"&gt;.&lt;/span&gt;method&lt;span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby"&gt;.&lt;/span&gt;to_s&lt;span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby"&gt;.&lt;/span&gt;upcase&lt;span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby"&gt;}&lt;/span&gt;&lt;/span&gt;]&lt;span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby"&gt;"&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;      logger&lt;span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby"&gt;.&lt;/span&gt;info &lt;span class="string string_quoted string_quoted_double string_quoted_double_ruby"&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby"&gt;"&lt;/span&gt;  Session ID: &lt;span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"&gt;&lt;span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby"&gt;#{&lt;/span&gt;&lt;span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby"&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby"&gt;@&lt;/span&gt;_session&lt;/span&gt;&lt;span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby"&gt;.&lt;/span&gt;session_id&lt;span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="keyword keyword_control keyword_control_ruby"&gt;if&lt;/span&gt; &lt;span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby"&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby"&gt;@&lt;/span&gt;_session&lt;/span&gt; &lt;span class="keyword keyword_operator keyword_operator_logical keyword_operator_logical_ruby"&gt;and&lt;/span&gt; &lt;span class="variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby"&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_ruby"&gt;@&lt;/span&gt;_session&lt;/span&gt;&lt;span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby"&gt;.&lt;/span&gt;respond_to?&lt;span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby"&gt;(&lt;/span&gt;&lt;span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby"&gt;:&lt;/span&gt;session_id&lt;/span&gt;&lt;span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby"&gt;)&lt;/span&gt;
&lt;br /&gt;      logger&lt;span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby"&gt;.&lt;/span&gt;info &lt;span class="string string_quoted string_quoted_double string_quoted_double_ruby"&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_ruby"&gt;"&lt;/span&gt;  Parameters: &lt;span class="source source_ruby source_ruby_embedded source_ruby_embedded_source"&gt;&lt;span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby"&gt;#{&lt;/span&gt;respond_to?&lt;span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby"&gt;(&lt;/span&gt;&lt;span class="constant constant_other constant_other_symbol constant_other_symbol_ruby"&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_constant punctuation_definition_constant_ruby"&gt;:&lt;/span&gt;filter_parameters&lt;/span&gt;&lt;span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby"&gt;)&lt;/span&gt; &lt;span class="keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby"&gt;?&lt;/span&gt; filter_parameters&lt;span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby"&gt;(&lt;/span&gt;params&lt;span class="punctuation punctuation_section punctuation_section_function punctuation_section_function_ruby"&gt;)&lt;/span&gt;&lt;span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby"&gt;.&lt;/span&gt;inspect &lt;span class="punctuation punctuation_separator punctuation_separator_other punctuation_separator_other_ruby"&gt;:&lt;/span&gt; params&lt;span class="punctuation punctuation_separator punctuation_separator_method punctuation_separator_method_ruby"&gt;.&lt;/span&gt;inspect&lt;span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_ruby"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_ruby"&gt;"&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;    &lt;span class="keyword keyword_control keyword_control_ruby"&gt;end&lt;/span&gt;
&lt;br /&gt;  &lt;span class="keyword keyword_control keyword_control_ruby"&gt;end&lt;/span&gt;
&lt;br /&gt;&lt;span class="keyword keyword_control keyword_control_ruby"&gt;end&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;&lt;p&gt;
&lt;br /&gt;	Nun wird die IP-Adresse nicht mehr gespeichert und die erste Zeile der Eintr&#228;ge im Logfile sieht wie folgt aus:
&lt;br /&gt;&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;Processing PostsController#index (2008-02-19 14:54:56) [GET]&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;p&gt;Eins noch: Um das &lt;a href="http://www.wirspeichernnicht.de/" title="wirspeichernnicht.de - Start"&gt;"Wir speichern nicht!"-Siegel&lt;/a&gt; zu bekommen, d&#252;rfte diese Ma&#223;nahme in den meisten F&#228;llen nicht ausreichen. Oft hat man ja noch einen loggenden Webserver oder einen Load-Balancer mit eigenen Logfiles vorgespannt. Die Protokollierung muss also auch dort noch abgestellt werden.&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;&lt;a rel="license" href="http://creativecommons.org/licenses/by/3.0/de/"&gt;&lt;img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/de/88x31.png" /&gt;&lt;/a&gt;&lt;br /&gt;This &lt;span xmlns:dc="http://purl.org/dc/elements/1.1/" href="http://purl.org/dc/dcmitype/Text" rel="dc:type"&gt;work&lt;/span&gt; by &lt;span xmlns:cc="http://creativecommons.org/ns#" property="cc:attributionName"&gt;pattex&lt;/span&gt; is licensed under a &lt;a rel="license" href="http://creativecommons.org/licenses/by/3.0/de/"&gt;Creative Commons Attribution 3.0 Germany License&lt;/a&gt;.
&lt;/p&gt;</content>
  </entry>
  <entry>
    <title>Hello World!</title>
    <link>https://bitlabor.net&lt;a href="/posts/1-Hello-World-.html"&gt;Hello World!&lt;/a&gt;</link>
    <id>tag:bilabor.ne,2008-02-17:/posts/1</id>
    <updated>2008-02-17T01:14:24+00:00</updated>
    <content type="html">&lt;p&gt;&lt;p&gt;Na da bekomme ich es doch tats&#228;chlich mal hin: bitlabor.net ist jetzt auch im Web.&lt;br /&gt;
&lt;br /&gt;Wer h&#228;tte das noch f&#252;r m&#246;glich gehalten?&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;Geplant ist diese Website als so etwas wie das Sprachrohr meiner gesammelten Nerdigkeit. Wenn ich es wirklich gebacken bekomme&#8230;&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;Bis dahin kann der geneigt Besucher ja das eine oder andere &lt;a href="http://adoptabit.bitlabor.net/" title="bitlabor.net: adopt a bit"&gt;Bit adoptieren&lt;/a&gt;.&lt;/p&gt;&lt;/p&gt;</content>
  </entry>
</feed>
