In First Class, Charles uses Cerebro to recruit mutants to help, one of the mutants he finds is Logan, he and Erik go to recruit, but he declines, so they both briefly meet Logan in 1962. In 1974, Stryker learn that his 11 years old son, Jason, is a mutant, he then seek Charles help to ''cure'' his son, Charles meets Stryker. Charles had meet Stryker's father in 1962, who was a CIA officer.
Charles then learned about Stryker's life, his work, later he learn about Stryker's work in Adamantium. Later, when Charles and Erik already had make amends, he talks about Stryker, about Stryker's life, his son, work, Stryker's work in Adamantium.
In Origins, Xavier, through Alex Summers/Havok, learned that Alex's brother was in danger, using Cerebro, he finds him in Three Mile Island, saving Scott and other mutants there. Xavier and Erik learned about Logan, through the mutants, saying that a mutant with metal claws helped them, they said he was one of Stryker's experiment that escaped and saved them, so the mutants said that William Stryker are responsible of capture of them.
Xavier read Logan's mind, seeing his second Weapon X's flashbacks, but don't understanding, because his mind is "broken"/fragile. Charles used Cerebro to find out where Stryker was and seen he was at Alkali Lake, so he send Logan to go there. Xavier decided to don't tell Logan and the X-Men about his knowledge of Logan because he wanted Logan to discover his past on his own. So both Charles and Erik knew about Logan before X1, as showing in X2.