Diary of a Madman is a short story written by Nikolai Gogol in 1834. The novel was published for the first time in the collected stories Arabesques with the title Shreds of Notes of a Madman in 1835. Later, it was included in the St. Petersburg narratives.
The plot of Diary of a Madman dates back to the two different Gogol’s intentions in the beginning of the 30s: to the Diary of a Mad Musician, mentioned in the content list of Arabesques and an unrealized comedy Vladimir of the 3rd degree. We can see from Gogol’s letter to Ivan Dmitriev, written on November, 30 1832, as well as from Pletnev’s letter to Zhukovskiy written in December 8, 1832, that at the time Gogol was fascinated by V. Odoevskiy’s novels of the series Madhouse being included later in the cycle Russian Nights and, really devoted to the development of the theme of imaginary or real madness in highly gifted ("genius") natures.
A number of domestic, stylistic and plot details moved from intention of a comedy about the officials, which was written by Gogol in 1834, to the Diary. A general, who dreams to get the order and confides his ambitious dreams to a lapdog, is described in the Morning officials, i. e. in the survived passage of the beginning of the comedy relating to 1832. We can easily found prototypes of Poprishchin and his environment in the other survived scenes of the comedy – these prototypes are in petty officials Schneider, Kaplunov and Petrushevich. Poprishchin’s review about the officials, who do not like to go to the theater, actually goes back to a dialogue between Kaplunov and Schneider about the German theater.
Thus, the picture of departmental life and manners in the Diary of a Madman related to the first Gogol's comedy intention, dates back to the Gogol's personal observations of his own at the time of service.