SlideShare a Scribd company logo
1 of 20
Download to read offline
Non-DIY* Logging
using
A Smalltalk Syslog library
* DIY: Do It Yourself
What is Syslog?
● RFC 3164 - The BSD syslog Protocol
● It's not a standard, but it is widely used
Status of this Memo
This memo provides information for the Internet community. It does
not specify an Internet standard of any kind. Distribution of this
memo is unlimited.
What is Syslog?
What is Syslog?
1. Introduction
Since the beginning, life has relied upon the transmission of
messages. For the self-aware organic unit, these messages can ...
From RFC 3164:
What is Syslog?
● It's way of using sockets to pass messages of
1024 octets in length that look like this:
<34>Oct 11 22:14:15 mymachine su: 'su root' failed
for lonvickon /dev/pts/8
What is Syslog?
● It's way of using sockets to pass messages of
1024 octets in length that look like this:
<34>Oct 11 22:14:15 mymachine su: 'su root' failed
for lonvickon /dev/pts/8
<165>Aug 24 05:34:00 CST 1987 mymachine myproc[10]:
%% It's time to make the do-nuts. %% Ingredients:
Mix=OK, Jelly=OK #Devices: Mixer=OK, Jelly_Injector
=OK, Frier=OK #Transport:Conveyer1=OK, Conveyer2=OK #
%%
What is Syslog?
● It's way of using sockets to pass messages of
1024 octets in length that look like this:
<34>Oct 11 22:14:15 mymachine su: 'su root' failed
for lonvickon /dev/pts/8
<165>Aug 24 05:34:00 CST 1987 mymachine myproc[10]:
%% It's time to make the do-nuts. %% Ingredients:
Mix=OK, Jelly=OK #Devices: Mixer=OK, Jelly_Injector
=OK, Frier=OK #Transport:Conveyer1=OK, Conveyer2=OK #
%%
Use the BFG!
Messages
● 1024 octets in length & composed like this:
– PRI
● e.g. <12> (User-Level Warning)
– Header
● e.g. Oct 11 22:14:15 myhost
– MSG
● e.g. hyper: bad request received from 12.63.103.16
The 3 Players
● Device (aka a Sender)
– Remarkably, sends syslog messages
● Collector (aka Receiver)
– A syslog server
● Relay
– Both a Receiver and a Sender
– Typically will filter and route messages
– Could also act as a collector
The Smalltalk Syslog Library
● OskSyslog in the public Store
– Developed in VW using Sport
– Available under the LGPL
– Used by OpenSkills in VW and GemStone
● An implementation of RFC 3164, including:
– Message
– Sender
– Receiver
– Relay
Sender
● The RFC says that messages must be sent to
UDP port 514
● Really should make sure the message is well
formed.
– “Use the BFG” is not so good
Simple Sender
● Using the logger command:
–>logger Hello, World.
–Sends a user notice to the local syslog server
–tail -f /var/log/messages
The Syslog Library
● OskSyslog in the public Store
● To repeat the Dead Simple Example:
| sender |
[| message |
sender := OSkSyslogSender sendingToHostNamed: '192.168.29.129'.
message := OSkSyslogEventMessage userLevelNotice:
'vwnc: A test from Smalltalk'.
sender send: message] ensure: [sender close].
Are you listening?
● Many syslog servers don't listen on UDP by
default
– They mostly listen on local *nix sockets
– Easy to switch on UDP listening, though. In
Debian:
vi /etc/default/syslogd (ensure SYSLOGD="-r")
/etc/init.d/sysklogd restart
sudo netstat -a | grep syslog (shows if it is indeed listening on UDP)
UDP vs. TCP
Jim Snow: http://syn.cs.pdx.edu/~jsnow/
UDP vs. TCP
Jim Snow: http://syn.cs.pdx.edu/~jsnow/
● Speed vs reliable delivery
– TCP does not guarantee delivery, but it will let you
know if a delivery failed.
● If you can't afford to lose a message or three
– ask yourself if what you are doing is really logging
Receiver
● Listens on UDP port 514
– Note that you'll need to run as root or use iptables
to redirect traffic from 514 to a port with a number >
1024
server := OSkSyslogReceiver onPort: 514
forEachMessageDo:
[:aSyslogMessage |
Transcript
cr;
show: aSyslogMessage asOctetArray asString].
Collector
● Uses a Receiver to get messages
– Keep
– Summarise
– Discard
● OpenSkills will be using PostgreSQL
– Looking for patterns over time
– ... and whatever else comes to mind
Relay
● Combination of
– a Receiver
– a Sender
● Can be used to
– Filter & Route messages
– Redirect messages over a port > 1024
– perhaps send alerts to pagers?
Summary
● Lots of existing tools
– e.g. less
● Best effort delivery with UDP
– If it absolutely definitely has to be there, use TCP
● Syslog
– The only way to fly for extra-image logging

More Related Content

What's hot

ZeroMQ: Super Sockets - by J2 Labs
ZeroMQ: Super Sockets - by J2 LabsZeroMQ: Super Sockets - by J2 Labs
ZeroMQ: Super Sockets - by J2 Labs
James Dennis
 
Tomas Hlavacek - IP fragmentation attack on DNS
Tomas Hlavacek - IP fragmentation attack on DNSTomas Hlavacek - IP fragmentation attack on DNS
Tomas Hlavacek - IP fragmentation attack on DNS
DefconRussia
 
Highload осень 2012 лекция 8
Highload осень 2012 лекция 8Highload осень 2012 лекция 8
Highload осень 2012 лекция 8
Technopark
 

What's hot (20)

How choosing the Raft consensus algorithm saved us 3 months of development time
How choosing the Raft consensus algorithm saved us 3 months of development timeHow choosing the Raft consensus algorithm saved us 3 months of development time
How choosing the Raft consensus algorithm saved us 3 months of development time
 
Quality of Service Ingress Rate Limiting and OVS Hardware Offloads
Quality of Service Ingress Rate Limiting and OVS Hardware OffloadsQuality of Service Ingress Rate Limiting and OVS Hardware Offloads
Quality of Service Ingress Rate Limiting and OVS Hardware Offloads
 
Configuring Syslog by Octavio
Configuring Syslog by OctavioConfiguring Syslog by Octavio
Configuring Syslog by Octavio
 
sshuttle VPN (2011-04)
sshuttle VPN (2011-04)sshuttle VPN (2011-04)
sshuttle VPN (2011-04)
 
Ostinato FOSS.IN 2010
Ostinato FOSS.IN 2010Ostinato FOSS.IN 2010
Ostinato FOSS.IN 2010
 
ZeroMQ: Super Sockets - by J2 Labs
ZeroMQ: Super Sockets - by J2 LabsZeroMQ: Super Sockets - by J2 Labs
ZeroMQ: Super Sockets - by J2 Labs
 
Hanz and Franz
Hanz and FranzHanz and Franz
Hanz and Franz
 
Istio - The life of a packet
Istio - The life of a packetIstio - The life of a packet
Istio - The life of a packet
 
OpenVPN
OpenVPNOpenVPN
OpenVPN
 
Matt Turner: Istio, The Packet's-Eye View (DevSecOps - London Gathering, Janu...
Matt Turner: Istio, The Packet's-Eye View (DevSecOps - London Gathering, Janu...Matt Turner: Istio, The Packet's-Eye View (DevSecOps - London Gathering, Janu...
Matt Turner: Istio, The Packet's-Eye View (DevSecOps - London Gathering, Janu...
 
Tomas Hlavacek - IP fragmentation attack on DNS
Tomas Hlavacek - IP fragmentation attack on DNSTomas Hlavacek - IP fragmentation attack on DNS
Tomas Hlavacek - IP fragmentation attack on DNS
 
Tutorial on using CoreOS Flannel for Docker networking
Tutorial on using CoreOS Flannel for Docker networkingTutorial on using CoreOS Flannel for Docker networking
Tutorial on using CoreOS Flannel for Docker networking
 
Docker Networking
Docker NetworkingDocker Networking
Docker Networking
 
ハイパフォーマンスブラウザネットワーキング2
ハイパフォーマンスブラウザネットワーキング2ハイパフォーマンスブラウザネットワーキング2
ハイパフォーマンスブラウザネットワーキング2
 
Mininet Basics
Mininet BasicsMininet Basics
Mininet Basics
 
Highload осень 2012 лекция 8
Highload осень 2012 лекция 8Highload осень 2012 лекция 8
Highload осень 2012 лекция 8
 
Creating qmgr and allowing remote authorization
Creating qmgr and allowing remote authorizationCreating qmgr and allowing remote authorization
Creating qmgr and allowing remote authorization
 
Open ZFS Keynote (public)
Open ZFS Keynote (public)Open ZFS Keynote (public)
Open ZFS Keynote (public)
 
Understanding Open vSwitch
Understanding Open vSwitch Understanding Open vSwitch
Understanding Open vSwitch
 
Workshop@naha val3
Workshop@naha val3Workshop@naha val3
Workshop@naha val3
 

Viewers also liked (8)

Parcels
ParcelsParcels
Parcels
 
Objects History
Objects HistoryObjects History
Objects History
 
Working Smarter, Not Harder
Working Smarter, Not HarderWorking Smarter, Not Harder
Working Smarter, Not Harder
 
Mars
MarsMars
Mars
 
Presenting at ESUG
Presenting at ESUGPresenting at ESUG
Presenting at ESUG
 
Toothpick
ToothpickToothpick
Toothpick
 
Squeak Update
Squeak UpdateSqueak Update
Squeak Update
 
Ignorance is not Bliss
Ignorance is not BlissIgnorance is not Bliss
Ignorance is not Bliss
 

Similar to Non-DIY* Logging

Similar to Non-DIY* Logging (20)

Advanced RAC troubleshooting: Network
Advanced RAC troubleshooting: NetworkAdvanced RAC troubleshooting: Network
Advanced RAC troubleshooting: Network
 
M|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScaleM|18 Architectural Overview: MariaDB MaxScale
M|18 Architectural Overview: MariaDB MaxScale
 
Turbo charge your logs
Turbo charge your logsTurbo charge your logs
Turbo charge your logs
 
Irc how to sept 2012
Irc how to   sept 2012Irc how to   sept 2012
Irc how to sept 2012
 
netLec5.pdf
netLec5.pdfnetLec5.pdf
netLec5.pdf
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
 
Gluster Storage
Gluster StorageGluster Storage
Gluster Storage
 
Primer to Browser Netwroking
Primer to Browser NetwrokingPrimer to Browser Netwroking
Primer to Browser Netwroking
 
UDP Hunter
UDP HunterUDP Hunter
UDP Hunter
 
03_clere-HTTP2 HTTP3 the State of the Art in Our Servers.pdf
03_clere-HTTP2 HTTP3 the State of the Art in Our Servers.pdf03_clere-HTTP2 HTTP3 the State of the Art in Our Servers.pdf
03_clere-HTTP2 HTTP3 the State of the Art in Our Servers.pdf
 
UDP Hunter
UDP HunterUDP Hunter
UDP Hunter
 
Udp hunter
Udp hunterUdp hunter
Udp hunter
 
Master Serial Killer - DEF CON 22 - ICS Village
Master Serial Killer - DEF CON 22 - ICS VillageMaster Serial Killer - DEF CON 22 - ICS Village
Master Serial Killer - DEF CON 22 - ICS Village
 
packet traveling (pre cloud)
packet traveling (pre cloud)packet traveling (pre cloud)
packet traveling (pre cloud)
 
Ltsp talk
Ltsp talkLtsp talk
Ltsp talk
 
Building zero data loss pipelines with apache kafka
Building zero data loss pipelines with apache kafkaBuilding zero data loss pipelines with apache kafka
Building zero data loss pipelines with apache kafka
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawn
 
0507 057 01 98 * Adana Klima Servisleri
0507 057 01 98 * Adana Klima Servisleri0507 057 01 98 * Adana Klima Servisleri
0507 057 01 98 * Adana Klima Servisleri
 
Shall we play a game
Shall we play a gameShall we play a game
Shall we play a game
 

More from ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
ESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
ESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
ESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
ESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
ESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG
 

More from ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Recently uploaded

Recently uploaded (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

Non-DIY* Logging

  • 1. Non-DIY* Logging using A Smalltalk Syslog library * DIY: Do It Yourself
  • 3. ● RFC 3164 - The BSD syslog Protocol ● It's not a standard, but it is widely used Status of this Memo This memo provides information for the Internet community. It does not specify an Internet standard of any kind. Distribution of this memo is unlimited. What is Syslog?
  • 4. What is Syslog? 1. Introduction Since the beginning, life has relied upon the transmission of messages. For the self-aware organic unit, these messages can ... From RFC 3164:
  • 5. What is Syslog? ● It's way of using sockets to pass messages of 1024 octets in length that look like this: <34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvickon /dev/pts/8
  • 6. What is Syslog? ● It's way of using sockets to pass messages of 1024 octets in length that look like this: <34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvickon /dev/pts/8 <165>Aug 24 05:34:00 CST 1987 mymachine myproc[10]: %% It's time to make the do-nuts. %% Ingredients: Mix=OK, Jelly=OK #Devices: Mixer=OK, Jelly_Injector =OK, Frier=OK #Transport:Conveyer1=OK, Conveyer2=OK # %%
  • 7. What is Syslog? ● It's way of using sockets to pass messages of 1024 octets in length that look like this: <34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvickon /dev/pts/8 <165>Aug 24 05:34:00 CST 1987 mymachine myproc[10]: %% It's time to make the do-nuts. %% Ingredients: Mix=OK, Jelly=OK #Devices: Mixer=OK, Jelly_Injector =OK, Frier=OK #Transport:Conveyer1=OK, Conveyer2=OK # %% Use the BFG!
  • 8. Messages ● 1024 octets in length & composed like this: – PRI ● e.g. <12> (User-Level Warning) – Header ● e.g. Oct 11 22:14:15 myhost – MSG ● e.g. hyper: bad request received from 12.63.103.16
  • 9. The 3 Players ● Device (aka a Sender) – Remarkably, sends syslog messages ● Collector (aka Receiver) – A syslog server ● Relay – Both a Receiver and a Sender – Typically will filter and route messages – Could also act as a collector
  • 10. The Smalltalk Syslog Library ● OskSyslog in the public Store – Developed in VW using Sport – Available under the LGPL – Used by OpenSkills in VW and GemStone ● An implementation of RFC 3164, including: – Message – Sender – Receiver – Relay
  • 11. Sender ● The RFC says that messages must be sent to UDP port 514 ● Really should make sure the message is well formed. – “Use the BFG” is not so good
  • 12. Simple Sender ● Using the logger command: –>logger Hello, World. –Sends a user notice to the local syslog server –tail -f /var/log/messages
  • 13. The Syslog Library ● OskSyslog in the public Store ● To repeat the Dead Simple Example: | sender | [| message | sender := OSkSyslogSender sendingToHostNamed: '192.168.29.129'. message := OSkSyslogEventMessage userLevelNotice: 'vwnc: A test from Smalltalk'. sender send: message] ensure: [sender close].
  • 14. Are you listening? ● Many syslog servers don't listen on UDP by default – They mostly listen on local *nix sockets – Easy to switch on UDP listening, though. In Debian: vi /etc/default/syslogd (ensure SYSLOGD="-r") /etc/init.d/sysklogd restart sudo netstat -a | grep syslog (shows if it is indeed listening on UDP)
  • 15. UDP vs. TCP Jim Snow: http://syn.cs.pdx.edu/~jsnow/
  • 16. UDP vs. TCP Jim Snow: http://syn.cs.pdx.edu/~jsnow/ ● Speed vs reliable delivery – TCP does not guarantee delivery, but it will let you know if a delivery failed. ● If you can't afford to lose a message or three – ask yourself if what you are doing is really logging
  • 17. Receiver ● Listens on UDP port 514 – Note that you'll need to run as root or use iptables to redirect traffic from 514 to a port with a number > 1024 server := OSkSyslogReceiver onPort: 514 forEachMessageDo: [:aSyslogMessage | Transcript cr; show: aSyslogMessage asOctetArray asString].
  • 18. Collector ● Uses a Receiver to get messages – Keep – Summarise – Discard ● OpenSkills will be using PostgreSQL – Looking for patterns over time – ... and whatever else comes to mind
  • 19. Relay ● Combination of – a Receiver – a Sender ● Can be used to – Filter & Route messages – Redirect messages over a port > 1024 – perhaps send alerts to pagers?
  • 20. Summary ● Lots of existing tools – e.g. less ● Best effort delivery with UDP – If it absolutely definitely has to be there, use TCP ● Syslog – The only way to fly for extra-image logging