{"__v":8,"_id":"56b8264a7ced7f17003ab1d0","api":{"auth":"required","params":[],"results":{"codes":[]},"settings":"","url":""},"body":"Seq is a log server that runs on a central machine. Your applications internally write structured events with a framework like [Serilog](http://serilog.net):\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"log.Error(\\\"Failed to log on user {ContactId}\\\", contactId);\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\nStructured logging preserves the individual property values, as well as the text, of each event.\n\nThese are sent across the network to Seq, which displays and makes them searchable:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/6d80777-DocsGettingStarted1.png\",\n        \"DocsGettingStarted1.png\",\n        1940,\n        1011,\n        \"#0765a7\"\n      ]\n    }\n  ]\n}\n[/block]\nGetting started is easy and quick. You need to:\n\n1. [Download](https://getseq.net/Download) and install the Seq server\n2. Add the appropriate NuGet package to your application\n\nAnd that's it! **:-)**\n\nHere we go step by step.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Installation\"\n}\n[/block]\nThe Seq server is a Windows service that accepts incoming events and hosts the main web user interface over HTTP or HTTPS.\n\nIf you're just setting up on your own developer workstation, you machine almost certainly have everything required. If you're hosting Seq on a shared server for your team, check out the [System Requirements](doc:system-requirements) and [Azure Installation Guide](doc:azure-installation).\n\n#### The Setup Wizard\n\nIf you haven't done so already, download the Seq installer now from the [https://getseq.net web site](https://getseq.net/Download).\n\nRunning the installer will show the Setup Wizard:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/e1iaTfM1Qtig7BAWANR2_GettingStarted-2.png\",\n        \"GettingStarted-2.png\",\n        \"506\",\n        \"395\",\n        \"#1f89f9\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nStep through each page of the wizard. On a developer workstation the defaults are fine. Check out the [Production Deployment Checklist](doc:production-deployment) if you're going \"live\".\n\nAfter the wizard completes, browse the Seq UI at [http://localhost:5341](http://localhost:5341).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Writing Structured Events\"\n}\n[/block]\nSeq has rich support for _structured log events_, and the optimal way to create those is with the open source [Serilog](http://serilog.net) logger.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Not using C#, or want to integrate with another logging library? Check out the _Inputs_ heading in the documentation contents to the left.\"\n}\n[/block]\nThe Serilog project provides a \"sink\" for Seq, which is released [via NuGet](https://nuget.org/packages/serilog.sinks.seq). It currently targets .NET 4+.\n\nAt the _Visual Studio Package Manager Console_ type:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"PM> Install-Package Serilog.Sinks.Seq -DependencyVersion Highest\\nPM> Install-Package Serilog.Sinks.ColoredConsole\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nThen, configure the logger and write some events. If you installed Seq to the default port you can use `\"http://your-seq-server:5341\"` as the Seq address; if you configured Seq to listen on a different port or hostname, enter those details in the `WriteTo.Seq()` line.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"using System;\\nusing Serilog;\\n \\nclass Program\\n{\\n    public static void Main()\\n    {\\n        Log.Logger = new LoggerConfiguration()\\n            .WriteTo.ColoredConsole()\\n            .WriteTo.Seq(\\\"http://localhost:5341\\\")\\n            .CreateLogger();\\n\\n        Log.Information(\\\"Hello, {Name}!\\\", Environment.UserName);\\n \\n        // Important to call at exit so that batched events are flushed.\\n        Log.CloseAndFlush();\\n\\n        Console.ReadKey(true);\\n     }\\n}\",\n      \"language\": \"csharp\",\n      \"name\": \"Program.cs\"\n    }\n  ]\n}\n[/block]\nRun the application - you will see something like:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/NKC2pQLRTi5YmGmdBFD4_GettingStarted-3.png\",\n        \"GettingStarted-3.png\",\n        \"1824\",\n        \"372\",\n        \"#58a3db\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nNow in the _events_ view of your Seq server, press the _Refresh_ button, which is shown with a circle icon on the right side of the filter box. The events you've just written will appear.\n\nClicking on the events will expand them to show their structured properties (`Name` in this example) and some controls for filtering.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/dd16fdb-DocsGettingStarted2.png\",\n        \"DocsGettingStarted2.png\",\n        1941,\n        583,\n        \"#0466ab\"\n      ]\n    }\n  ]\n}\n[/block]\nTry typing some text into the filter bar and pressing `Enter`: Seq will display log events that contain the text in the message or associated exception.\n\nEach property associated with an event, as well as its level and type, can be used for searching. Use the 'green tick' and 'red cross', _Level_, and _Type_ menus to get started.\n\nBeside the refresh button is the _auto-refresh_ toggle. Choose this to see events in Seq as they arrive!\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Troubleshooting\"\n}\n[/block]\n> Nothing showed up, what can I do?\n\nIf the events don't display when Seq is refreshed, the console application was probably unable to contact the Seq server.\n\nAdd the following line after the logger is configured to print any error information to the console:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Serilog.Debugging.SelfLog.Enable(Console.Error);\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\nIt is also important to close the console window by pressing a key; Windows console apps are terminated \"hard\" if the close button in the title bar is used, so events buffered for sending to Seq may be lost if you use it.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"What Next?\"\n}\n[/block]\nOnce your apps are happily sending events to Seq, you can:\n\n* Learn about the flexible Seq [filter syntax](doc:query-syntax)\n* Create some [signals](doc:signals) to provide quick access to different filters\n* Set up some [retention policies](doc:retention-policies) to control disk usage\n\nHave fun!","category":"56b826497ced7f17003ab1bf","createdAt":"2015-05-18T06:51:03.174Z","excerpt":"Seq is the easiest way for development teams to capture, search and integrate structured log events! This page will walk you through the very quick setup process.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"55598bd507b1710d0055f9c8","slug":"getting-started","sync_unique":"","title":"Getting Started with Seq","type":"basic","updates":["571f050ac10a771700e93cdb"],"user":"5559568d97777719007d5317","version":"56b826487ced7f17003ab1be","childrenPages":[]}

Getting Started with Seq

Seq is the easiest way for development teams to capture, search and integrate structured log events! This page will walk you through the very quick setup process.

Seq is a log server that runs on a central machine. Your applications internally write structured events with a framework like [Serilog](http://serilog.net): [block:code] { "codes": [ { "code": "log.Error(\"Failed to log on user {ContactId}\", contactId);", "language": "csharp" } ] } [/block] Structured logging preserves the individual property values, as well as the text, of each event. These are sent across the network to Seq, which displays and makes them searchable: [block:image] { "images": [ { "image": [ "https://files.readme.io/6d80777-DocsGettingStarted1.png", "DocsGettingStarted1.png", 1940, 1011, "#0765a7" ] } ] } [/block] Getting started is easy and quick. You need to: 1. [Download](https://getseq.net/Download) and install the Seq server 2. Add the appropriate NuGet package to your application And that's it! **:-)** Here we go step by step. [block:api-header] { "type": "basic", "title": "Installation" } [/block] The Seq server is a Windows service that accepts incoming events and hosts the main web user interface over HTTP or HTTPS. If you're just setting up on your own developer workstation, you machine almost certainly have everything required. If you're hosting Seq on a shared server for your team, check out the [System Requirements](doc:system-requirements) and [Azure Installation Guide](doc:azure-installation). #### The Setup Wizard If you haven't done so already, download the Seq installer now from the [https://getseq.net web site](https://getseq.net/Download). Running the installer will show the Setup Wizard: [block:image] { "images": [ { "image": [ "https://files.readme.io/e1iaTfM1Qtig7BAWANR2_GettingStarted-2.png", "GettingStarted-2.png", "506", "395", "#1f89f9", "" ] } ] } [/block] Step through each page of the wizard. On a developer workstation the defaults are fine. Check out the [Production Deployment Checklist](doc:production-deployment) if you're going "live". After the wizard completes, browse the Seq UI at [http://localhost:5341](http://localhost:5341). [block:api-header] { "type": "basic", "title": "Writing Structured Events" } [/block] Seq has rich support for _structured log events_, and the optimal way to create those is with the open source [Serilog](http://serilog.net) logger. [block:callout] { "type": "info", "body": "Not using C#, or want to integrate with another logging library? Check out the _Inputs_ heading in the documentation contents to the left." } [/block] The Serilog project provides a "sink" for Seq, which is released [via NuGet](https://nuget.org/packages/serilog.sinks.seq). It currently targets .NET 4+. At the _Visual Studio Package Manager Console_ type: [block:code] { "codes": [ { "code": "PM> Install-Package Serilog.Sinks.Seq -DependencyVersion Highest\nPM> Install-Package Serilog.Sinks.ColoredConsole", "language": "shell" } ] } [/block] Then, configure the logger and write some events. If you installed Seq to the default port you can use `"http://your-seq-server:5341"` as the Seq address; if you configured Seq to listen on a different port or hostname, enter those details in the `WriteTo.Seq()` line. [block:code] { "codes": [ { "code": "using System;\nusing Serilog;\n \nclass Program\n{\n public static void Main()\n {\n Log.Logger = new LoggerConfiguration()\n .WriteTo.ColoredConsole()\n .WriteTo.Seq(\"http://localhost:5341\")\n .CreateLogger();\n\n Log.Information(\"Hello, {Name}!\", Environment.UserName);\n \n // Important to call at exit so that batched events are flushed.\n Log.CloseAndFlush();\n\n Console.ReadKey(true);\n }\n}", "language": "csharp", "name": "Program.cs" } ] } [/block] Run the application - you will see something like: [block:image] { "images": [ { "image": [ "https://files.readme.io/NKC2pQLRTi5YmGmdBFD4_GettingStarted-3.png", "GettingStarted-3.png", "1824", "372", "#58a3db", "" ] } ] } [/block] Now in the _events_ view of your Seq server, press the _Refresh_ button, which is shown with a circle icon on the right side of the filter box. The events you've just written will appear. Clicking on the events will expand them to show their structured properties (`Name` in this example) and some controls for filtering. [block:image] { "images": [ { "image": [ "https://files.readme.io/dd16fdb-DocsGettingStarted2.png", "DocsGettingStarted2.png", 1941, 583, "#0466ab" ] } ] } [/block] Try typing some text into the filter bar and pressing `Enter`: Seq will display log events that contain the text in the message or associated exception. Each property associated with an event, as well as its level and type, can be used for searching. Use the 'green tick' and 'red cross', _Level_, and _Type_ menus to get started. Beside the refresh button is the _auto-refresh_ toggle. Choose this to see events in Seq as they arrive! [block:api-header] { "type": "basic", "title": "Troubleshooting" } [/block] > Nothing showed up, what can I do? If the events don't display when Seq is refreshed, the console application was probably unable to contact the Seq server. Add the following line after the logger is configured to print any error information to the console: [block:code] { "codes": [ { "code": "Serilog.Debugging.SelfLog.Enable(Console.Error);", "language": "csharp" } ] } [/block] It is also important to close the console window by pressing a key; Windows console apps are terminated "hard" if the close button in the title bar is used, so events buffered for sending to Seq may be lost if you use it. [block:api-header] { "type": "basic", "title": "What Next?" } [/block] Once your apps are happily sending events to Seq, you can: * Learn about the flexible Seq [filter syntax](doc:query-syntax) * Create some [signals](doc:signals) to provide quick access to different filters * Set up some [retention policies](doc:retention-policies) to control disk usage Have fun!